A
awalker1
Hi all,
I have a datagrid and a drop down list on my page.
The DataGrid is created dynamically at runtime to contain columns based on
the item that the user has selected from the drop down list. Some of the
columns need to be a ButtonColumn so that the user can click on them to be
taken to another page. This "click" is handled by the ItemCommand" event of
the datagrid.
In order to correctly associate the ItemCommand event to the dynamically
created button columns, I have to setup the grid in the Page_Init event. If
I don't do it here then the event never gets fired (and this is well
documented on the net).
My problem is that in order to set the grid up correctly, I need to access
the SelectedItem of the combo box in the Page_Init event, BUT, the combo box
hasn't been initialised at this point. I can access the combo box in the
Page_Load event but this is too late to setup the grid. I'm in a catch 22.
So, how can I access the SelectedItem of my combo box in the Page_Init
event? If I can't access it directly, can I access it through another
route?
Help please?
Andy
I have a datagrid and a drop down list on my page.
The DataGrid is created dynamically at runtime to contain columns based on
the item that the user has selected from the drop down list. Some of the
columns need to be a ButtonColumn so that the user can click on them to be
taken to another page. This "click" is handled by the ItemCommand" event of
the datagrid.
In order to correctly associate the ItemCommand event to the dynamically
created button columns, I have to setup the grid in the Page_Init event. If
I don't do it here then the event never gets fired (and this is well
documented on the net).
My problem is that in order to set the grid up correctly, I need to access
the SelectedItem of the combo box in the Page_Init event, BUT, the combo box
hasn't been initialised at this point. I can access the combo box in the
Page_Load event but this is too late to setup the grid. I'm in a catch 22.
So, how can I access the SelectedItem of my combo box in the Page_Init
event? If I can't access it directly, can I access it through another
route?
Help please?
Andy