Hi,
I'm using a RadGrid with AllowPaging=true and AllowCustomPaging=true.
The grid also has the events PageSizeChanged and PageIndexChanged enabled.
In Page_Load I'm setting the grid PageSize to 50 but when running the page it only shows 10 rows and I figure it out the cause to be in the pageSizeChanged event.
It looks like this:
The grid is only showing 10 rows because of the rebind() call.
Do I need to save the grids PageSize property in ViewState or Session or something and reset it somewhere or what is best practice when using custom paging?
(thou I have tried to reset the PageSize in the event above but the then the hole page times out)
/Mattias
I'm using a RadGrid with AllowPaging=true and AllowCustomPaging=true.
The grid also has the events PageSizeChanged and PageIndexChanged enabled.
In Page_Load I'm setting the grid PageSize to 50 but when running the page it only shows 10 rows and I figure it out the cause to be in the pageSizeChanged event.
It looks like this:
| protected void radGridCompanies_PageSizeChanged(object source, Telerik.Web.UI.GridPageSizeChangedEventArgs e) |
| { |
| //_take = radGridCompanies.PageSize; |
| //Label1.Text = "ny:" + radGridCompanies.PageSize.ToString(); |
| //radGridCompanies.PageSize = e.NewPageSize; |
| //_skip = e.NewPageIndex * radGridCompanies.PageSize; |
| //radGridCompanies.PageSize = radGridCompanies.PageSize; |
| //_skip = 0; |
| radGridCompanies.CurrentPageIndex = 0; |
| //radGridCompanies.DataSource = null; |
| radGridCompanies.Rebind(); |
| } |
The grid is only showing 10 rows because of the rebind() call.
Do I need to save the grids PageSize property in ViewState or Session or something and reset it somewhere or what is best practice when using custom paging?
(thou I have tried to reset the PageSize in the event above but the then the hole page times out)
/Mattias