We need to save the selected new page size to a session.
We have tried the PageSizeChanged event but the NewPageSize returns 0.
Is there a way we could get the new page size value? How? Thanks.
We need to save the selected new page size to a session.
We have tried the PageSizeChanged event but the NewPageSize returns 0.
Is there a way we could get the new page size value? How? Thanks.
I was able to get what I need by
protected void Page_Load(object sender, EventArgs e) {
int newPageSize = ((RadDataPager)RadListView1.FindControl("RadDataPager1")).PageSize;
if ((int)Session["ImagesPerPage"] != newPageSize) {
Session["ImagesPerPage"] = newPageSize;
}
RadListView1.PageSize = (int)Session["ImagesPerPage"];
}
This seems kind of hack. Any other more elegant ways to do this?
How about using the DataBound event of the listview for the same purpose? It seems the more appropriate place to store the page size in cache or session than each time on PageLoad.