Skip to main content

DataGridView.GroupBy(GridColumn) Method

Groups data in the grid by the specified column.

Namespace: DevExpress.Maui.DataGrid

Assembly: DevExpress.Maui.DataGrid.dll

NuGet Package: DevExpress.Maui.DataGrid

Declaration

public void GroupBy(
    GridColumn column
)

Parameters

Name Type Description
column GridColumn

A GridColumn class descendant that specifies the column by whose values data is grouped.

Remarks

Use the GroupBy property to group data in the grid by column values. Another way to group data by a column is to set this column’s GridColumn.IsGrouped property to true.

DataGridView can group data by a single column only. When you group data by a column, the grid discards the previously applied grouping by another column.

When you group data by a specific column, the grid combines data rows into groups. Each group contains rows with the same value in the field (column) for which grouping has been applied. The GridColumn.GroupInterval property allows you to change the default logic used to decide which rows should be grouped together. For example, when you group data by a column that contains dates, you can set this column’s GroupInterval property to ColumnGroupInterval.DateYear to combine data rows into groups according to the year part of date values.

To cancel grouping, use the DataGridView.ClearGrouping method.

See Also