Skip to main content
Tab

VerticalGridDataRow.SortIndex Property

Gets or sets the row’s position among sorted rows.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue(-1)]
public int SortIndex { get; set; }

Property Value

Type Default Description
Int32 -1

An integer value that specifies the zero-based row’s index among sorted rows. -1 if data is not sorted by these rows.

Remarks

The ASPxVerticalGrid allows data sorting by multiple rows. Once a row is sorted, it is automatically added to the collection of sorted rows. If no rows were previously sorted, the row becomes the only element in the collection and gets the 0 sort index. If sorting by an additional row, the newly sorted row is appended to the collection and gets the 1 index, etc.

When data is sorted by multiple rows, you can change the position (order) of sorted rows using the SortIndex property. Note that changing the sorted row position changes order of data rows (which are records in the vertical grid).

Setting the SortIndex property to a non-negative integer, the row is added to the sorted rows list. The row’s VerticalGridDataRow.SortOrder property is automatically set to ColumnSortOrder.Ascending. Setting a row’s SortIndex property value to -1 cancels data sorting by this row.

Sorting is allowed if the ASPxGridBehaviorSettings.AllowSort property is set to true.

See Also