Blazor DataGrid Example - Row Grouping
Order ID Press Enter to sort. Press Ctrl space to group. Press Alt Down to open filter Menu | Customer ID Sorted in ascending order. Press Ctrl space to group. Press Alt Down to open filter Menu | Freight Press Enter to sort. Press Alt Down to open filter Menu | Order Date Press Enter to sort. Press Ctrl space to group. Press Alt Down to open filter Menu | Order Time Press Enter to sort. Press Ctrl space to group. Press Alt Down to open filter Menu |
|---|
This sample demonstrates the DataGrid grouping feature for organizing and hierarchically displaying records.
The Blazor DataGrid supports record grouping based on specified columns. When grouping is enabled, records are organized hierarchically, allowing users to expand and collapse grouped data. To enable grouping, set the AllowGrouping property to true.
In this demo:
- The DataGrid is initially grouped by the Customer ID column
- Columns can be grouped by dragging and dropping column headers into the group drop area
- The PersistGroupState option maintains the expand or collapse state during paging, sorting, or filtering
To enable group state persistence across operations, set the PersistGroupState property to true. By default, this property is set to false.
For more detailed information about grouping, refer to the grouping documentation.