Telerik MVC Grid filterBy not working

2019-08-19 06:26发布

问题:

I am facing a similar problem to this question has anybody found a solution to it

http://www.telerik.com/community/forums/aspnet-mvc/grid/grid-does-not-filter-when-filterby-major-startswith-mba.aspx#1795473

the sample application here is also not filtering

http://www.telerik.com/community/forums/aspnet-mvc/grid/is-there-a-way-to-save-grid-stage.aspx#1224347

回答1:

The application you have referred uses hidden fields that are updated through js on DataBound event of the grid like

$('#currentPage').val(currentPage);
            $('#orderBy').val(orderBy);
            $('#groupBy').val(groupBy);
            $('#filterBy').val(filterBy);

However, if you have a look at keys that grid posts when filtering, it looks like
so, in that application if you are trying to access filtering info in _index method which provides data to grid ajaxically, you have to change parameter name from filterBy to filter like

public ActionResult _Index(string page, string orderBy, string filterBy, string groupBy)