This is a migrated thread and some comments may be shown as answers.

How to Add Space in Image and Text

1 Answer 70 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
sachin
Top achievements
Rank 1
sachin asked on 26 Mar 2009, 02:22 PM
Hi

I want add an image into RadPanelBarHeader Part
Below is my code

<

 

telerik:RadPanelBarItem.Header>

 

 

 

<Grid HorizontalAlignment="Center" VerticalAlignment="Center">

 

 

 

<Grid.ColumnDefinitions>

 

 

 

<ColumnDefinition Width="04*"/>

 

 

 

<ColumnDefinition Width="0.6*"/>

 

 

 

</Grid.ColumnDefinitions>

 

 

 

<Grid.RowDefinitions>

 

 

 

<RowDefinition Height="*"/>

 

 

 

</Grid.RowDefinitions>

 

 

 

<Image Source="Images/companies_icon.PNG" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="0" />

 

 

 

<TextBlock x:Name="tbCompany" Text="Companies" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="1" FontFamily="Verdana" FontSize="12"/>

 

 

 

</Grid>

 

 

 

</telerik:RadPanelBarItem.Header>

But I want some space between companies_icon.PNG image and Companies Text.
How can i add space between these 2 controls.

Please help me.

Regards,
sachin

 

1 Answer, 1 is accepted

Sort by
0
Tihomir Petkov
Telerik team
answered on 26 Mar 2009, 03:23 PM
Hi sachin,

You can just set a margin to your image:

<telerikNavigation:RadPanelBarItem.Header>
<StackPanel Orientation="Horizontal">
<Rectangle Fill="Red" Height="18" Width="18" Margin="0,0,20,0" />
<TextBlock x:Name="tbCompany" Text="Companies" FontFamily="Verdana" FontSize="12"/>
</StackPanel>
</telerikNavigation:RadPanelBarItem.Header>


I used a rectangle instead of an image, but you can just put an image in its place. Also, it would be much easier if you use a  data template for your items, unless you want to manually set the headers of each individual item.

Sincerely yours,
Tihomir Petkov
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
PanelBar
Asked by
sachin
Top achievements
Rank 1
Answers by
Tihomir Petkov
Telerik team
Share this question
or