How can I change font size of categories?

Grids for WPF Forum

Posted 11 years ago by Dariusz Wąsacz
Version: 12.2.0573

I'd like to change the category appearance for all categories in PropertyGrid. I'd like to set font color to Gray, FontSize to 14 (bigger than properties) and FontWeight to Normal. I tried the following code:


            <Style TargetType="{x:Type propgrid:PropertyGridDataAccessorItem}">
                    <Trigger Property="DataAccessorType"
                        <Setter Property="Foreground"
                                Value="Gray" />
                        <Setter Property="FontSize"
                                Value="14" />
                        <Setter Property="FontWeight"
                                Value="Normal" />

 This code doesn't give the correct effect:

  1. The font color of categories is set correctly to Gray
  2. FontSize affects both categories and properties. I don't want properties to have bigger font size.
  3. FontWeight is not changed - it remains Bold.

What should I correct to have the desired effect?

Comments (2)

Answer - Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Dariusz,

Instead of setting those three properties, try to set the HeaderTemplate property instead.  Our default value is:

<Setter Property="HeaderTemplate">
			<TextBlock Text="{Binding}" />

You can set the properties you want right on that TextBlock.

Actipro Software Support

Posted 11 years ago by Dariusz Wąsacz

It works perfect. Thank you :-)

The latest build of this product (v24.1.2) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.