Skip to main content

GridSortInfoCollection.GroupByColumn(String, Int32, ColumnSortOrder, MergeGroupPosition, Boolean) Method

Groups data by the values of the specified column.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v23.1.dll

NuGet Package: DevExpress.Wpf.Grid.Core


public void GroupByColumn(
    string fieldName,
    int index,
    ColumnSortOrder sortOrder = ColumnSortOrder.Ascending,
    MergeGroupPosition mergeGroupPosition = MergeGroupPosition.None,
    bool refreshMerge = true


Name Type Description
fieldName String

A String value that specifies the column’s field name.

index Int32

An integer value that specifies the column’s position among grouping columns.

Optional Parameters

Name Type Default Description
sortOrder ColumnSortOrder 1

A ColumnSortOrder enumeration value that specifies the column’s sort order.

mergeGroupPosition MergeGroupPosition 0

A MergeGroupPosition enumeration value that specifies the merging position.

refreshMerge Boolean True

A Boolean value that specifies whether the merged column should or not change the GridColumn.MergeWithPreviousGroup property to false.


Data rows are always sorted against the grouping columns. If data is grouped against a column which isn’t sorted, the grid automatically applies sorting in ascending order to this column.

To learn more, see Grouping in Code.


The refreshMerge parameter is in effect when the mergeGroupPosition parameter is set to MergeGroupPosition.Right.

See Also