Skip to main content
A newer version of this page is available. .

ColumnView.SortedColumns Property

Gets the collection of columns involved in sorting.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v19.2.dll

Declaration

[Browsable(false)]
public GridColumnReadOnlyCollection SortedColumns { get; }

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.

The following code snippets (auto-collected from DevExpress Examples) contain references to the SortedColumns property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also