I have an empty RadPanelBar on my webpage. When I say empty, I mean that just the <telerik:RadPanelBar></telerik:RadPanelBar> definition exists with no RadPanelItems in it.
On page load, I check to see if the page has been posted back, and if not, I create and add a dynamic number of RadPanelItems to the RadPanelBar. Each of these RadPanelItems has a control in it (for testing I'm using a textbox, but eventually it will be a RadGrid).
I run my page for the first time and up comes my RadPanelBar with the right number of RadPanelItems, and in each one is a textbox. I enter a value into a textbox and click a submit button and the page postsback to itself.
Now when my page loads, a strange thing happens...
The event that loads the RadPanelItems does not fire but the RadPanelBar still has the dynamically added RadPanelItems, but these items have no controls in them so now my textboxes have disappeared and I have no access to the values that were entered into them.
If I skip the check and load the RadPanelItems everytime the page is hit, the I get more strangeness...
The original RadPanelItems that were created when the page was first loaded are still there, along with newly created RadPanelItems after postback, the new RadPanelItems have the empty textboxes in them, but the existing RadPanelItems again have no textboxes and again I've lost my values.
How on earth do I get around this? I need to dynamically add RadPanelItems and controls to a RadPanelBar, but then need access to these and the controls in them so I can access their values after postback!
On page load, I check to see if the page has been posted back, and if not, I create and add a dynamic number of RadPanelItems to the RadPanelBar. Each of these RadPanelItems has a control in it (for testing I'm using a textbox, but eventually it will be a RadGrid).
I run my page for the first time and up comes my RadPanelBar with the right number of RadPanelItems, and in each one is a textbox. I enter a value into a textbox and click a submit button and the page postsback to itself.
Now when my page loads, a strange thing happens...
The event that loads the RadPanelItems does not fire but the RadPanelBar still has the dynamically added RadPanelItems, but these items have no controls in them so now my textboxes have disappeared and I have no access to the values that were entered into them.
If I skip the check and load the RadPanelItems everytime the page is hit, the I get more strangeness...
The original RadPanelItems that were created when the page was first loaded are still there, along with newly created RadPanelItems after postback, the new RadPanelItems have the empty textboxes in them, but the existing RadPanelItems again have no textboxes and again I've lost my values.
How on earth do I get around this? I need to dynamically add RadPanelItems and controls to a RadPanelBar, but then need access to these and the controls in them so I can access their values after postback!