GridColumnSortInfoCollection.ClearSorting() Method

Removes the collection's items which refer to the columns used to sort data (grouping columns are not affected).

Namespace: DevExpress.XtraGrid.Columns

Assembly: DevExpress.XtraGrid.v20.1.dll

Declaration

public void ClearSorting()
Public Sub ClearSorting

Remarks

The first elements in the GridColumnSortInfoCollection collection define the columns used to group data. The number of these columns is specified by the GridColumnSortInfoCollection.GroupCount property. The subsequent elements identify the columns which are only used to sort data. These elements are removed by the ClearSorting method from the collection. The grouping elements are not affected.

The number of the elements in the collection after a ClearSorting call will match the value of the GridColumnSortInfoCollection.GroupCount property.

To remove all the elements from the collection (including the grouping ones) use the Clear method. This will remove both the sorting and grouping settings applied to any column.

The ClearSorting and Clear methods can be used to remove sorting/grouping before adding new sorting and grouping settings via the GridColumnSortInfoCollection.AddRange method for instance.

The ClearSorting method is equivalent to the View's ColumnView.ClearSorting method.

See Also