Change FontSize of property name in RadPropertyGrid

2 posts, 0 answers
  1. Ilya
    Ilya avatar
    3 posts
    Member since:
    May 2013

    Posted 11 Jun 2014 Link to this post

    Hello.

    How can I change size of font of names of properties in RadPropertyGrid? I have AutoGeneratePropertyDefinitions="True", so everything generates automatic. Furthermore I would like to do it in xaml file if it is possible. 

    I have just tried to set FontSize for the RadPropertyGrid and it didn't work. Moreover I think there is different sizes for different text fields in RadPropertyGrid.

    I have attached a picture of what I am talking about.

    Thank you for help,
    Ilya.
  2. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 12 Jun 2014 Link to this post

    Hi Ilya,

    In order to achieve your goal, you need to edit the template of the PropertyGridField. Then you can change the font size of the TextBlock named "PART_FieldLabelN":
    <TextBlock
                                        FontFamily="Calibri"
                                        IsHitTestVisible="True"
                                        FontWeight="Normal"
                                        FontSize="13"
                                        Foreground="{telerik:Office2013Resource ResourceKey=InvertedBrush}"
                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                        Margin="9,2,0,2"
                                        Text="{Binding DisplayName}"
                                        x:Name="PART_FieldLabelN"/>

    For your convenience, I have attached a sample project that demonstrates the approach.

    I hope it helps.

    Regards,
    Yoan
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top