How to Add Space in Image and Text

2 posts, 0 answers
  1. sachin
    sachin avatar
    7 posts
    Member since:
    Nov 2008

    Posted 26 Mar 2009 Link to this post

    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

     

  2. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 26 Mar 2009 Link to this post

    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.
  3. DevCraft banner
Back to Top