MVCContrib Grid - Sort(GridSortOptions, prefix) not generating links for sorting

萝らか妹 提交于 2019-12-25 01:55:41

问题


I'm trying to use two grids in the same page and following what I found here:

http://mvccontrib.codeplex.com/workitem/7032

Has anyone else had a problem with the Sort() method not generating links?

The sorting was working before but it was sorting both grids the same way. The only thing I have changed is added the Bind attributes as the page above instructs and added the prefix to the call to Sort.


回答1:


So the mvccontrib grid code checks if the SortOptions has been populated and if the column is sortable. If false, no links.

Apparently the BindAttribute causes the default model binder to NOT populate the paramter objects first time through which in this case meant my GridSortOption parameters were both null.



来源:https://stackoverflow.com/questions/7518581/mvccontrib-grid-sortgridsortoptions-prefix-not-generating-links-for-sorting

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