I am using the Windows Community Toolkit DataGrid control in my WinUI3 project.
I would like to make the group header text bold. How can I do this?
Currently the group header looks like this (not bold):
I have tried setting styles:
<ctWinUI:DataGrid ...>
<ctWinUI:DataGrid.RowGroupHeaderStyles>
<Style TargetType="ctWinUI:DataGridRowGroupHeader">
<Setter Property="PropertyNameVisibility" Value="Collapsed"/>
<Setter Property="ItemCountVisibility" Value="Collapsed"/>
<Setter Property="FontWeight" Value="Bold"/> <!--Ignored-->
</Style>
<Style TargetType="TextBlock">
<Setter Property="FontWeight" Value="Bold"/> <!--Ignored-->
</Style>
</ctWinUI:DataGrid.RowGroupHeaderStyles>
...
</ctWinUI:DataGrid>
You should be able to override the BodyTextBlockStyle
theme resource:
<ctWinUI:DataGrid.Resources>
<Style x:Key="BodyTextBlockStyle" TargetType="TextBlock">
<Setter Property="FontWeight" Value="Bold" />
</Style>
</ctWinUI:DataGrid.Resources>