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.v24.2.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

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

Parameters

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 Ascending

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

mergeGroupPosition MergeGroupPosition None

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.

Remarks

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.

Note

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

See Also