Hello my sorting is not working at all, no matter what I do. If I look in firebug the json-encoded response shows up but it is not sorted correctly, if I put a breakpoint in the "Get" method the request.Sorts parameter is null. It shows the arrows inside the columns but nothing else happens.
here is the code for the view
And here is the controller action that gets called
here is the code for the view
@(Html.Kendo().Grid<
ModelNewsletter
>().Name("NewslettersGrid").Columns(c => {
c.Bound(m => m.Title);
c.Bound(m => m.DateCreated).Format("{0:dd/MM/yyyy}");
c.Bound(m => m.AccommodationName);
}).DataSource( d => d
.Ajax()
.Read(r => r.Action("Get", "Newsletter"))
.PageSize(5)
)
.Pageable()
.Sortable(sb => sb.AllowUnsort(true).SortMode(GridSortMode.SingleColumn))
.ToolBar(toolbar => toolbar.Custom().Action("Create", "Newsletter").Text("Create"))
)
And here is the controller action that gets called
[HttpGet]
public
JsonResult Get([DataSourceRequest]DataSourceRequest request) {
uow.SetContextProxyCreation(
false
);
var newsletters = uow.NewslettersRepository.GetNewslettersByCompanyForGrid(SessionHandler.User.IDCompany);
var ds = newsletters.ToDataSourceResult(request);
return
this
.Json(ds,
"text/x-json"
, JsonRequestBehavior.AllowGet);
}