This is a migrated thread and some comments may be shown as answers.

How to change PageSize of Grid

3 Answers 84 Views
Grid
This is a migrated thread and some comments may be shown as answers.
AG
Top achievements
Rank 1
AG asked on 10 May 2011, 01:00 PM
Hi all,

This is supposed to be simple but some how not working for me. I tried changing page size from grid at runtime but doesnt change the page size and it always come  back at 10 . Any suggestions ?


I am adding columns from code behind and rebinding the grid at page load.




Regards,

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 May 2011, 01:32 PM
Hello,

I have tried to replicate the same at my end but no avail. Could you please verify your code with the help document code.
Programmatic creation

Thanks,
Shinu.
0
AG
Top achievements
Rank 1
answered on 10 May 2011, 01:47 PM
Hi Shinu,

Thanks for the reply . this is what i am doing

protected void Page_Load(object sender, EventArgs e)

 

{

 

 

if (!IsPostBack)

 

 

{

 

 

 

CommonCDRCls<Object, string>.CurrentForm = this;

 

 

 

 

CommonCDRCls<Object, string>.SetCommonSettings();

 

 

}

 

 

 

this.gridControl.Rebind();

 

 

}

 

 

 

/// <summary>

 

 

 

/// Creates grid columns

 

 

 

/// </summary>

 

 

 

/// <param name="sender"></param>

 

 

 

/// <param name="e"></param>

 

 

 

protected void Page_Init(object sender, EventArgs e)

 

 

{

 

LoadGridColumns();

 

}

 


LoadGridColumns is creating columns at backend

0
Tsvetina
Telerik team
answered on 13 May 2011, 06:50 AM
Hi,

Try moving the logic that adds columns and sets RadGrid properties on initial Page_Load (!isPostBack)? This is generally how you should set up RadGrid when it is created in mark-up but customized in back end.

Also, after setting the PageSize in Page_Load, you do not need to rebind the grid, especially if you are using the NeedDataSource event.

If the issue persists, please post your grid declaration from mark-up and the code that you use for setting its properties.

Regards,
Tsvetina
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.

Tags
Grid
Asked by
AG
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
AG
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or