DataGridView.GroupBy(String) Method

Groups data in the grid by the specified column.

Namespace: DevExpress.XamarinForms.DataGrid

Assembly: DevExpress.XamarinForms.Grid.dll

Declaration

public void GroupBy(
    string fieldName
)

Parameters

Name Type Description
fieldName String

The field name of the column by whose values data is grouped.

Remarks

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

DataGridView allows grouping 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