5 Answers, 1 is accepted
1

Masaab
Top achievements
Rank 1
answered on 18 Aug 2014, 03:17 AM
TO Sort a Grid That is bound to a server dataSource.
@(Html.Kendo().Grid<
DataTableRow
>()<
br
> .Name("GridDisplay")<
br
> .DataSource(dataSource =><
br
> {<
br
> dataSource<
br
> .Ajax()<
br
> .Read(read => read.Action("ActionName", "Controller", new {Id = @Model.Id}))<
br
> .PageSize(10)<
br
> .Sort(a => a.Add("Date/Time").Descending())<
br
> .ServerOperation(false);<
br
><
br
> }<
br
> )
1

Brice
Top achievements
Rank 2
answered on 14 Sep 2018, 11:18 AM
Default sorting should be defined in the datasource configuration.
You could check documentation at this adress: https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/sort#sort
Example :
var
dataSource =
new
kendo.data.DataSource({
data: [
{ name:
"Jane Doe"
, age: 30 },
{ name:
"John Doe"
, age: 33 }
],
sort: { field:
"age"
, dir:
"desc"
}
});
0
This should be the proper link to the relevant help article section, guys:
http://docs.telerik.com/kendo-ui/api/framework/datasource#configuration-serverSorting
Regards,
Sebastian
Telerik
http://docs.telerik.com/kendo-ui/api/framework/datasource#configuration-serverSorting
Regards,
Sebastian
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
-1

Pechka
Top achievements
Rank 1
answered on 01 May 2012, 06:25 AM
pucsoftware
commented on 10 Dec 2012, 09:38 PM
Top achievements
Rank 1
I also need to have the grid's sort property established on the initial page request. The link provided below show's how to invoke the "sort" method of the data source but not how to pre-configure the datastore or grid to already have an initial sorted field. I'm sure it can be done but don't see how based on this link. Can you provide more info?
Chrys
commented on 17 Jun 2014, 10:54 PM
Top achievements
Rank 1
This seems to be bad link only links to the landing page for keno
-1

Marcin Butlak
Top achievements
Rank 2
answered on 11 Dec 2012, 10:27 PM