0

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):

group header, 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>
Felix
  • 3,783
  • 5
  • 34
  • 53

1 Answers1

1

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>
Felix
  • 3,783
  • 5
  • 34
  • 53
mm8
  • 163,881
  • 10
  • 57
  • 88