New to Telerik UI for ASP.NET Core? Download free 30-day trial

Sorting

By default, the sorting functionality of the Telerik UI Grid for ASP.NET Core is disabled.

Getting Started

To control the sorting in the Grid, use the Sortable option.

@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.OrderViewModel>()
    .Name("Grid")
    .Sortable()
    ...

Only columns that are bound to a field can be sortable. To enable sorting on a column bound to an object, bind the column to a field of that object.

Sort Modes

The Grid supports single and multiple columns sort modes which can be set through its SortMode property. You can also specify if the columns can be unsorted by setting the AllowUnsort property to true or false. For a runnable example, refer to the demo on sorting in the Grid.

With multi-column sorting you can also configure the Grid to display the sort indexes in the header by setting the ShowIndexes property to true.

.Sortable(sortable => sortable
        .AllowUnsort(true)
        .SortMode(GridSortMode.MultipleColumn)
        .ShowIndexes(true))

See Also

In this article
Not finding the help you need? Improve this article