Persist grid page size across session in all grids
Is it possible to persist the selected pageSize so that when it changes, the new pageSize is applied to all grids? Currently, I am saving the GridParams PageSize (g.PageSize) in ViewData and then setting the grid's .PageSize() property to the ViewData value. This works fine when the grid initially refreshes, but if I refresh the page, or load another page with a grid, it reverts back to the default 10. This makes it difficult to know whether g.PageSize is actually a change based on user selecting a new page size or just reloading the default value.
asked at 13 Oct 2019
you could save the latest `g.PageSize` in a session variable Session["ps"] = g.PageSize; and in the markup set @Html.Awe().Grid("grid1") .PageSize((int?) Session["ps"] ?? 10) and you can choose to use this code on all grids or just a few
answered at 13 Oct 2019
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our