ColumnView.SortedColumns Property
Gets the collection of columns involved in sorting.
Namespace: DevExpress.XtraGrid.Views.Base
Assembly: DevExpress.XtraGrid.v24.1.dll
NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation
Declaration
Property Value
Type | Description |
---|---|
GridColumnReadOnlyCollection | A GridColumnReadOnlyCollection object representing the collection of columns involved in sorting. |
Remarks
Grid Views and Card Views support sorting by the values of multiple columns. The columns involved in sorting can be obtained via the SortedColumns property. This property can be used if you need, for instance, to traverse sorted columns to perform operations on them. For instance, you may want to change all such columns to sort them in ascending order. Note that the collection object returned by the SortedColumns property doesn’t allow columns to be added or removed. To apply or cancel sorting by column values, use the column’s GridColumn.SortOrder property.
The order of columns within the obtained collection is specified by the GridColumn.SortIndex column property.
Grid Views lets you group data by specific columns. Although grouping columns are always sorted, they are not included in the SortedColumns collection. To get the grouping columns, use the ColumnView.GroupedColumns collection.
The ColumnView.SortInfo property provides access to the sorted and grouping columns at once. You can also use this property to group or sort data by a specific column.