Skip to main content

GridColumnSortOrder Enum

Lists values that specify a column’s sort order.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public enum GridColumnSortOrder

Members

Name Description
None

Grid sorts column data in ascending order.

Ascending

Grid sorts column data in ascending order.

Descending

Grid sorts column data in descending order.

Related API Members

The following properties accept/return GridColumnSortOrder values:

Remarks

Use the SortOrder property to specify a column’s sort order.

@using Microsoft.EntityFrameworkCore
@inject IDbContextFactory<NorthwindContext> NorthwindContextFactory
@implements IDisposable

<DxGrid Data="GridDataSource">
    <Columns>
        <DxGridDataColumn FieldName="OrderDate"
                          DisplayFormat="d"
                          SortIndex="1" />
        <DxGridDataColumn FieldName="ShipName" />
        <DxGridDataColumn FieldName="ShipCity" />
        <DxGridDataColumn FieldName="Freight"
                          DisplayFormat="n2"
                          SortIndex="0"
                          SortOrder="GridColumnSortOrder.Descending" />
    </Columns>
</DxGrid>

@code {
    object GridDataSource { get; set; }
    NorthwindContext Northwind { get; set; }

    protected override void OnInitialized() {
        Northwind = NorthwindContextFactory.CreateDbContext();
        GridDataSource = Northwind.Orders.ToList();
    }

    public void Dispose() {
        Northwind?.Dispose();
    }
}

Run Demo: Grid - Sort Data

Watch Video: Grid - Sort Data

See Also