I am unable to get my grid to filter on more than 1 column. When I try to add the 2nd filter I get a 500 error because it seems Kendo is trying to make a call to my MVC action without any parameters. I'm getting this behavior on 2 different grid and dataources.
Grid (shortened):
@(Html.Kendo().Grid<FooItemViewModel>()
.Name("FooGrid")
.Columns(column =>
{
column.Bound(p => p.FooTypeCode).Title("Type").Width(22);
column.Bound(p => p.FooCode).Title("Foo Code").Width(40);
column.Bound(p => p.FooDesc).Title("Foo Description").Width(260);
column.Bound(p => p.ReportCode).Title("Report").Width(20);
})
.Filterable()
.Sortable()
.Pageable(builder => builder.PageSizes(new[] { 10, 25, 100 }))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(25)
.Model(m =>
{
m.Id(s => s.FooID);
m.Field(s => s.FooID).Editable(false);
})
.Read(read => read.Action("Read", "Foo"))
.Create(create => create.Action("Create", "Foo"))
.Update(update => update.Action("Update", "Foo"))
.Destroy(update => update.Action("Delete", "Foo"))
.Events(events => events.Error("onDataSourceError"))
))
Controller:
public JsonResult Read([DataSourceRequest] DataSourceRequest request)
{
var Foos = _db.Foos.Project().To<FooItemViewModel>();
DataSourceResult response = Foos.ToDataSourceResult(request);
return Json(response, JsonRequestBehavior.AllowGet);
}
I have tried adding .ServerOperation(true), but that does not work. When the grid first loads I hit the Read action with empty datasourcerequest as expected. When I add a filter I also hit the server read action with a datasourcerequest and the expected column filter passed in. When I select a 2nd column filter and click "Filter" I get the 500 error in the console because it appears it tries to just call \Foo\Read without any parameters.
I see a "serverFiltering: true" in jquery version, but no equivalent in the MVC wrappers. Any help appreciated.