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

DataSourceSortDescriptorBuilder

Methods

Ascending()

Applies ascending order.

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                  .Name("dataSource")
                   .Ajax(dataSource => dataSource
                      .Read(read => read.Action("Orders_Read", "DataSource"))
                      .Sort(s=>s.Add(x=>x.OrderID).Ascending())
                   )
            )

Descending()

Applies descending order.

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                  .Name("dataSource")
                   .Ajax(dataSource => dataSource
                      .Read(read => read.Action("Orders_Read", "DataSource"))
                      .Sort(s=>s.Add(x=>x.OrderID).Descending())
                   )
            )

Order(Kendo.Mvc.ListSortDirection)

Applies ascening or descending order.

Parameters

direction - ListSortDirection

The ListSortDirection

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                  .Name("dataSource")
                   .Ajax(dataSource => dataSource
                      .Read(read => read.Action("Orders_Read", "DataSource"))
                      .Sort(s=>s.Add(x=>x.OrderID).Order(ListSortDirection.Ascending))
                   )
            )

In this article
Not finding the help you need?