or
<div id="userGrid" data-role="grid" data-columns='[{ "field": "Name", "title": "Users"}]' data-filterable='true' data-navigatable="false" data-pageable='true' data-selectable="row" data-sortable='{"mode": "single", "allowUnsort": true}' data-bind="source: userDataSource"></div>
public ActionResult ListUsers([DataSourceRequest] DataSourceRequest request) { return Json(GetUsers().ToDataSourceResult(request)); } When using attribute-driven, the grid works fine listing the records and the paging also works. But not the filter and sorting. Debugging the controller, I found out that the "request" parameter only has the Page and PageSize values, while the Filter and Sort properties are null. Looking at the POST request sent by each version of the grid, I found some differences. This is the request sent by the Grid created with the MVC helper: sort:
page:1
pageSize:10
group:
filter:Name~contains~'aaa' And this is the request sent by the attribute-driven: take:30
skip:0
page:1
pageSize:30
sort[0][field]:Name
sort[0][dir]:asc
filter[filters][0][field]:Name
filter[filters][0][operator]:contains
filter[filters][0][value]:25
filter[logic]:and
read: function (options) { $.ajax({ url: '/home/ListUsers', type: 'POST', data: options.data, success: function (data, textStatus, jqXHR) { options.success(data); }, error: function (jqXHR, textStatus, errorThrown) { alert(errorThrown); } }); }
@(Html.Kendo().DatePicker().Name("Test").Value(DateTime.Now))<input name="Test" id="Test" value="@DateTime.Now" /><script type="text/javascript"> $(document).ready(function () { $('#DebutJ').kendoDatePicker(); });</script>public ActionResult Grid_Read([DataSourceRequest]DataSourceRequest request){ var dbContext= new DataBaseContext(); IQueryable<Report> ReportData = from ParentRecord in ParentTable join ChildRecord in ChildTable on ParentRecord.Id equals ChildRecord.ParentId select new ReportModel { FieldOne = ParentRecord.FieldOne, FieldTwo = ParentRecord.FieldTwo, FieldThree = ChildRecord.FieldThree }; DataSourceResult result = ReportData .ToDataSourceResult(request); return Json(result);}