Skip to main content

DxDataGridColumn.SortIndex Property

Specifies the column’s index among sorted columns. If the property is set to -1, the grid data is not sorted by this column.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v22.1.dll


public int SortIndex { get; set; }

Property Value

Type Default Description
Int32 -1

Specifies the zero-based column’s index among sorted columns. -1 if the grid does not sort data by this column.



The Data Grid was moved to maintenance support mode. No new features/capabilities will be added to this component. We recommend that you migrate to the Grid component.

Set a column’s SortIndex property to a zero-based integer value to sort grid data by this column in code. If you sort data by multiple columns, this property specifies the sort level. For instance, the grid first sorts data by a column with SortIndex = 0 and then by a column with SortIndex = 1.

Use the SortOrder property to specify the sort order (the default order is ascending).


If you do not specify these properties, the Data Grid is sorted by a data source field that is marked with the Key attribute. If the data source does not contain a key field, component data is not sorted.

<DxDataGrid Data="@DataSource">
    <DxDataGridColumn Field="@nameof(Customer.City)"
    <DxDataGridColumn Field="@nameof(Customer.Country)"
    @* ... *@

DataGrid Sort

If you set the column’s SortIndex property to a negative integer value (for instance, -1), the grid is not sorted by the corresponding column.

Run Demo: Data Grid - Sort Data

See Also