Set PropertyGrid's font-family is not working.

5 posts, 0 answers
  1. Ye HaoChen
    Ye HaoChen avatar
    27 posts
    Member since:
    Nov 2009

    Posted 16 Jun 2014 Link to this post

    Hi,

    I want to change PropertyGrid font-family, Code like this:

    <telerik:RadPropertyGrid Name="squidProperties" Grid.Row="1" RenderMode="Flat"
               AutoGeneratePropertyDefinitions="False"
                            DescriptionPanelVisibility="Collapsed"                        
              FontFamily="Microsoft YaHei" Item="{Binding testtest}" LabelColumnWidth="100"
              Visibility="{Binding test}" />

    it's not working.

    The textblock's(PART_FieldLabelN) font-family is still Segoe UI.
  2. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 18 Jun 2014 Link to this post

    Hello,

    In order to achieve your goal, you need to edit the template of the PropertyGridField. Then you can change the font family of the TextBlock named "PART_FieldLabelN":

    <TextBlock
                                        FontFamily="Microsoft YaHei"
                                        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
  4. haochen
    haochen avatar
    13 posts
    Member since:
    Jun 2014

    Posted 30 Mar 2015 in reply to Yoan Link to this post

    Hi,

    Did you fix this problem in the new version?
  5. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 30 Mar 2015 Link to this post

    Hi,

    Yes. It is working with our latest official version - 2015.1.0225.

    Regards,
    Yoan
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  6. haochen
    haochen avatar
    13 posts
    Member since:
    Jun 2014

    Posted 30 Mar 2015 in reply to Yoan Link to this post

    Thank you
Back to Top
UI for WPF is Visual Studio 2017 Ready