3 Answers, 1 is accepted
0
Hello Hamza,
To get the new page size value you can use the following code in PreRender event of Grid and save the new page size to a HiddenField for example:
Regards,
Pavlina
the Telerik team
To get the new page size value you can use the following code in PreRender event of Grid and save the new page size to a HiddenField for example:
protected void RadGrid1_PreRender(object sender, EventArgs e) { GridPagerItem pagerItem = (GridPagerItem)RadGrid1.MasterTableView.GetItems(GridItemType.Pager)[0]; RadComboBox combo = (RadComboBox)pagerItem.FindControl("PageSizeComboBox"); HiddenField1.Value = combo.SelectedValue; }Regards,
Pavlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Hamza
Top achievements
Rank 1
answered on 30 Jun 2011, 11:55 AM
Hello Pavlina,
I have used the code and found the error message Out of bounds array index while i have not used any array indexing in the code. Please advise.
Thanks,
Hamza
I have used the code and found the error message Out of bounds array index while i have not used any array indexing in the code. Please advise.
Thanks,
Hamza
0
Princy
Top achievements
Rank 2
answered on 30 Jun 2011, 12:08 PM
Hello Hamza,
I cannot reproduce the issue. Here is the code that I tried.
aspx:
C#:
Please elaborate your scenario if it doesn't help.
Thanks,
Princy.
I cannot reproduce the issue. Here is the code that I tried.
aspx:
<telerik:RadGrid ID="RadGrid1" AutoGenerateColumns="false" AllowPaging="true"PageSize="5" OnNeedDataSource="RadGrid1_NeedDataSource"runat="server"onprerender="RadGrid1_PreRender"> <MasterTableView CommandItemDisplay="Top"> <Columns> <telerik:GridBoundColumn DataField="EmployeeID" HeaderText="EmployeeID" UniqueName="EmployeeID"></telerik:GridBoundColumn> </Columns> </MasterTableView></telerik:RadGrid>C#:
protected void RadGrid1_PreRender(object sender, EventArgs e) { GridPagerItem pagerItem = (GridPagerItem)RadGrid1.MasterTableView.GetItems(GridItemType.Pager)[0]; RadComboBox combo = (RadComboBox)pagerItem.FindControl("PageSizeComboBox"); Response.Write(combo.SelectedValue); }Please elaborate your scenario if it doesn't help.
Thanks,
Princy.