I have a pager template that I use on all my grids. My pager template has the ability to change the page size just like the default pager. I would have thought that this functionality would be supported through client side scripts, just like all the other standard methods and properties associated with the pager:
.GotoPage()
.NextPage()
.PrevPage()
.PageCount
.PagerIndex
If setting the PageSize using a client side script is available, I can't find it. Nevertheless, I found a way to set the PageSize by reviewing some of the other responses on your site. The way I'm doing it requires no additional code in the controllers, however, at some point I started getting a warning around the following code:
@Html.DevExpress().GridView(
settings =>
{
…
settings.CustomCallback = (sender, e) =>
{
int rowCount = Int32.Parse(e.Parameters);
MVCxGridView grd = (MVCxGridView)sender;
grd.SettingsPager.PageSize = rowCount;
grd.DataBind();
};
…
}).Bind(Model).GetHtml()
The warning is :
Warning: 'DevExpress.Web.Mvc.GridViewSettings.CustomCallback' is obsolete: '"Use the GridViewSettings.CustomActionRouteValues property instead."'
I don't quite understand what I should do to fix this without changing the code in every single controller. Please see the attached project. Any insight you can give me would be greatly appreciated.
Thanks,
Gene