Modifying Group Row
This article explains how you can modify the default header and footer templates of the group row. You can do that by predefining the GroupHeaderTemplate
and GroupFooterTemplate
properties.
Learn more about the GridView visual structure in this article.
Please note that the DataContext of the group row is GroupViewModel. As you can check in the API reference, this class contains properties like Group, Column, AggregateResults, etc. Having this in mind you can bind the TextBlock-s in the GroupHeaderTemplate to the values of the properties in the GroupViewModel.
Overriding GroupHeaderTemplate
The following examples demonstrates how to set the GroupHeaderTemplate
for a GridViewDataColumn
.
Setting the GridViewDataColumn GroupHeaderTemplate
GroupHeaderTemplate
for the RadGridView
.
Setting the RadGridView GroupHeaderTemplate
Hiding the aggregates in the group row
The
GroupHeaderRow
element is the default grouping visual element when theGroupRenderMode
of theRadGridView
is set to Flat. You can learn more about this in the Grouping Modes article.
Overriding GroupFooterTemplate
You can override the visual representation of the group footers by setting the GroupFooterTemplate
of the GridViewDataColumn.
Setting the GridViewDataColumn GroupFooterTemplate
You can check the implementation of Totals RadGridView example from the WPF Demos.
Setting Minimum Height on the Group Row
RadGridView exposes the GroupHeaderRowMinHeight
property that allows you to specify the minimum height for the GroupHeaderRow
element. This property will be taken into account only when the GroupRenderMode
property of RadGridView is set to Flat.
Setting the GroupHeaderRowMinHeight property
If you want to style the GroupHeaderRow further, you can check out this article.