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.v20.1.dll

Declaration

public void GroupByColumn(
    string fieldName,
    int index,
    ColumnSortOrder sortOrder = ColumnSortOrder.Ascending,
    MergeGroupPosition mergeGroupPosition = MergeGroupPosition.None,
    bool refreshMerge = true
)
Public Sub GroupByColumn(
    fieldName As String,
    index As Integer,
    sortOrder As ColumnSortOrder = ColumnSortOrder.Ascending,
    mergeGroupPosition As MergeGroupPosition = MergeGroupPosition.None,
    refreshMerge As Boolean = 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

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.

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