开发者

How to get the selected new page size of telerik's radlistview

We need to s开发者_Go百科ave 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜