Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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