Last post Jul 12, 2008 05:27 AM by MelvynHarbour
Jul 11, 2008 08:35 PM|buckbuchanan|LINK
Hi. I have hit a bit of a problem....
I have a control which reads in from an xml file and in turn makes other controls (e.g. the xml file may tell it to create a text box and a button which it will add to its controls collection). It can also tell it to create other custom controls.
Now... it all works fine, except for 1 thing... I have a custom control which has a grid view in it. The grid view has a radio button in each row which indicates the row is selected. When the page is posted back I want to raise an event which gets the selected
row in the grid view and then changes the controls which are loaded.
The trouble I have is that the selected row is not there when I fire my event - the data has loaded into the grid but the radio button which was selected hasn't been set (I guess this is to do with the ViewState not being loaded?). It seems that by the time
the radio button is loaded from ViewState it is too late for me to change the controls.
Can anyone think of a way around this? Specifically I just want to be able to force the control with the grid view to load it's ViewState so that I can see what the selected row is and move on.
Thanks for any advice.
Jul 12, 2008 05:27 AM|MelvynHarbour|LINK
The trouble is that the order that ASP.NET does things in means that you will always have this sort of problem. Your only real solution if you want to go down this route is to look into using something like