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

Sorting

To request sorted data on initial load, configure the sort options in the DataSourceSortDescriptorFactory. The ToDataSourceResult() extension method will return only the sorted data in the response object.

  • The Sort method sets the initial sorts.

    .Ajax()
    .Read(read => read.Action("Products_Read", "Home"))
    .Sort(sort =>
    {
        //Sort by the UnitsInStock in descending order.
        sort.Add(product => product.UnitsInStock).Descending();
        // Then sort by the ProductName in ascending order.
        sort.Add(product => product.ProductName);
    })
    

See Also

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