I have a webtab with 3 tabs. A webdatatree in the first tab, a dropdownlist in the second tab that are preloaded. In the third tab I allow the user to change or add data that thfirst two controls have populated. After saving the data on the third tab I call the routines to reload the Tree and the dropdownlist. Each routine clears out the control and re binds. Stepping through the code it does go through each of the routines correctly but when i go to either of the first two tabs the controls were not updated with the new data. I do not want to do a postback on the webtab tab change (unless there is a way to do a conditional postback based on which tab I select).
Everything works ok if I have postbacks allowed on the WebTab and reload the controls as I click on the tab.
Is the WebTab not refreshing my controls or am doing something else wrong?
Thanks!
Hi oqlf,
If you have Ajax enabled tabs, you could access and refresh all tabs, using the following syntax:
protected void WebTab1_SelectedIndexChanged(object sender, Infragistics.Web.UI.LayoutControls.TabSelectedIndexChangedEventArgs e)
{
foreach (ContentTabItem tab in WebTab1.Tabs)
tab.GetUpdatePanel(true).Update();
}
Please let me know if this helps.
Hi. I was looking for an answer for this behavior. I did noticed that people here did not understand fully what jcmo meant.
Basically, the webtab is creating automatically updatepanels for each tabs in that default setting. So when one tab does a postback, as when he saves, its an async postback happening. But as in any other async postbacks, all other update panels will not refresh if they dont have an option like updatemode="always". But to fix this kind of behavior, you normally use 2 of the techniques :
code behind with updatepanel.update()
or triggers. But here is the problem, since the update panels are creating dynamically, how do we send an update command on them in the tabs? that is the real question. Is there a way to find in the tabs this update panel taht is created upon load and if we can, can we force an update? Thank you!
Hi jcom39201,
I'm glad you solved your issue. If you have any other questions, please do not hesitate to ask.
Nikolay,
Your example got me thinking and I finally figured out to put an updatepanel around my control and it worked.
I ran your example and tried to apply it to my tab but still no luck. The main issue is that on tab1 i have a webdatatree that is populated by a LOADTREE routine. In the tree is a list of building names. On tab2 I allow the user to change the name of a building selected from a listbox. There is also a save button on tab2 that runs a sql update to the database. In the save routine of the button I also call the LOADTREE routine to repopulate the webdatatree on tab1 during the postback of the save routine on tab2. The LOADTREE routine does get processed on the save. After the postback I then select tab1 (no postback set on the tab control) expecting the webdatatree to be refreshed with the new building name. It isn't though. Still shows old building name.
Thanks for your help.