Skip to main content

GridColumnSortInfoCollection.AddRange(GridColumnSortInfo[], Int32) Method

Adds an array of GridColumnSortInfo objects to the current collection and sets how many columns are used to group data.

Namespace: DevExpress.XtraGrid.Columns

Assembly: DevExpress.XtraGrid.v24.1.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

public void AddRange(
    GridColumnSortInfo[] sortInfos,
    int groupCount
)

Parameters

Name Type Description
sortInfos GridColumnSortInfo[]

An array of GridColumnSortInfo objects to add to the current collection.

groupCount Int32

An integer value specifying how many columns are used to group data.

Remarks

Adding elements to the collection automatically applies sorting/grouping by the corresponding columns.

The AddRange method appends the specified GridColumnSortInfo objects to the current collection. Then the GridColumnSortInfoCollection.GroupCount property is initialized with the groupCount parameter’s value. It specifies the number of columns starting from the beginning of the current collection that are used to group data. All the subsequent columns will be used only to sort data. Thus if the groupCount is set to 0 all the columns referred to by the collection’s elements will be used to sort data, none of them will be used for grouping.

An element cannot be added to the collection in specific cases. See the GridColumnSortInfoCollection.Add topic for more information.

See Also