Blazor DataGrid Example - Group and Caption Aggregates
Drag a column header here to group its column
Category Name Press Ctrl space to group | Product Name Press Ctrl space to group | Quantity per Unit Press Ctrl space to group | Units in Stock Press Ctrl space to group | Discontinued Press Ctrl space to group |
|---|
| No records to display |
This sample demonstrates the DataGrid's aggregate functionality with group footer and group caption display options.
The Blazor DataGrid supports aggregates displayed in the footer, group footer, and group caption sections. Configure aggregates using the GridAggregates component.
The built-in aggregate types are:
- Sum - Calculates total sum
- Average - Calculates average value
- Min - Identifies minimum value
- Max - Identifies maximum value
- Count - Counts total records
- TrueCount - Counts boolean true values
- FalseCount - Counts boolean false values
In this demo:
- The GroupFooterTemplate displays group footer aggregates for Units in Stock and Discontinued columns using Sum aggregate type
- The GroupCaptionTemplate displays group caption aggregates for Units in Stock column using Max aggregate type
Configure aggregates by setting the Type and Field properties. Access aggregate values in templates using the Type name (e.g., SumValue.Sum) where the prefix is the implicit Context parameter.
For more detailed information about group and caption aggregates, refer to the group and caption aggregate documentation.