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

Persisting Grid created in code behind

1 Answer 45 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adonis
Top achievements
Rank 1
Adonis asked on 13 Oct 2010, 01:23 AM
I have a grid that is created programmatically during page.init , I then add the grid to a radpanelitem  which has also been created programmatically during page.init I can find the panel item but the instance of the grid is not maintained , How the grid instance be maintained ?

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvetina
Telerik team
answered on 18 Oct 2010, 10:33 AM
Hi Adonis,

In order to persist the RadGrid over postbacks, you may consider loading its settings in Page_Load as that is where the page's ViewState is loaded and accessible. This can be achieved if you declare the controls in mark-up but load their settings in the Page_Load event handler, as described in this help article.

If this is not an option, you would need to access the grid later in the page's lifecycle, not in Page_Init.

Best wishes,
Tsvetina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Adonis
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or