Telerik MVC Grid filterBy not working

此生再无相见时 提交于 2019-12-11 22:09:50

问题


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)


来源:https://stackoverflow.com/questions/7414387/telerik-mvc-grid-filterby-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!