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


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







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








    <ColumnDefinition Width="04*"/>




    <ColumnDefinition Width="0.6*"/>












    <RowDefinition Height="*"/>








    <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"/>









    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.



  2. Tihomir Petkov
    Tihomir Petkov avatar
    576 posts

    Posted 26 Mar 2009 Link to this post

    Hi sachin,

    You can just set a margin to your image:

    <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"/>

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