Skip to main content

DxGridDataColumn.AllowSort Property

Specifies whether users can sort data in this column.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v22.2.dll

NuGet Package: DevExpress.Blazor


public bool? AllowSort { get; set; }

Property Value

Type Default Description
Nullable<Boolean> null

true to allow users to sort column data; otherwise, false.


The DxGrid allows users to sort its data.

  • To apply sorting for one column, users can click the column header. They can click the header again to change the sort order. The sort glyph indicates the column’s current sort order.

  • To sort the Grid against multiple columns, users should click column headers with the Shift key pressed.

  • To clear sorting, users can hold the Ctrl key and click the column headers.

Sort Data

Set the AllowSort property to false to disable sorting for an individual column.

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

<DxGrid Data="GridDataSource">
        <DxGridDataColumn FieldName="OrderDate"
                          DisplayFormat="d" />
        <DxGridDataColumn FieldName="ShipName"
        <DxGridDataColumn FieldName="ShipCity" />
        <DxGridDataColumn FieldName="Freight"
                          DisplayFormat="n2" />

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

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

    public void Dispose() {

To disable sorting for the entire grid, use the DxGrid.AllowSort property.


You can use the column’s SortIndex property or SortBy method to sort data in code regardless of the AllowSort property value.

Run Demo: Grid - Sort Data

Watch Video: Grid - Sort Data

View Example: Grid - Custom Sorting


See Also