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,
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,