Blazor DataGrid Example - Row Grouping
This sample demonstrates grouping feature of the DataGrid component. In this sample, the DataGrid data is grouped against Customer ID column. To group any other column, simply drag and drop the column header onto the group drop area.
Order ID Press Enter to sort. Press Ctrl space to group | Customer ID Sorted in ascending order. Press Ctrl space to group | Order Date Press Enter to sort. Press Ctrl space to group | Order Time Press Enter to sort. Press Ctrl space to group | Freight Press Enter to sort |
---|
The Blazor DataGrid control provides the ability to group records based on the required column. When grouping is used, grouped records are organised into a hierarchical structure to allow for easier record expansion and collapsing. Set the AllowGrouping property to true to enable grouping.
The DataGrid in this demo is rendered with grouping enabled and is initially grouped by the Customer ID column. Columns can be grouped by dragging and dropping the column header onto the group drop area.
More information about the Grouping feature can be found in this documentation section.