Skip to main content

GridViewColumnState.SortIndex Property

Gets or sets the column’s position among sorted columns.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v24.1.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public int SortIndex { get; set; }

Property Value

Type Description
Int32

An integer value that specifies the zero-based column’s index among sorted columns. -1 if data is not sorted by this column.

Remarks

The GridView allows data sorting by multiple columns. Once a column is sorted, it is automatically added to the collection of sorted columns. If no columns were previously sorted, the column becomes the only element in the collection and gets the 0 sort index. If sorting by more than one column, the newly sorted column is appended to the collection and gets an index of 1, etc.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SortIndex 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