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

How to change the RadGrid Structure at Runtime?

1 Answer 142 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pooya
Top achievements
Rank 1
Pooya asked on 10 Jun 2011, 09:06 AM
I have a RadGrid control which is created programmatically when Page_Init event. It contains 3 columns.

I have a drop downlist on the top of the page containing 1, 2 and 3 (I also have few other controls which will affect the layout of the RadGrid such as RadDatePicker, RadSlider and asp:CheckBoxList).

When 1 is selected from the drop down list, the RadGrid control should be created with 1 column; when 2 is selected from the drop down list, the grid should have only 2 columns.

How is it possible?

The problem I'm facing is that at Page_Init event, I don't know which item was selected from the drop downlist as the control view state is not yet initialized.

If I move the RadGrid creation to the Page_Load event, then I've read that (haven't tried it myself) it won't work as I'm using Template Columns.

How to change the RadGrid Structure at Runtime for the scenario mentioned?

Many thanks,

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 10 Jun 2011, 11:05 AM
Hello Pooya,

Please check out the following documentation article:
http://www.telerik.com/help/aspnet-ajax/grid-changing-structure-dynamically.html

I hope this helps.

Best wishes,
Radoslav
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
Pooya
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or