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 jcom39201,
I am not sure I understand your issue. Could you please clarify your question? If you don't want a postback on tab change, I would suggest that you try setting the AutoPostBackFlags-SelectedIndexChanged property to 'Off'. If set to 'Async', changing active tab will initiate an asynchronous postback.
Please let me know if you have any other questions.
I do have the postback set to off, but when the user does a save function on tab3 I also run the code to reload controls (webdropdown and webdatatree) on tabs 1 and 2. However, the code does run but when I go to either tab1 or tab2 the dropdown and the tree have not been updated with the changes made from tab3.
The only way I have been able to get the updates to work is to set the postback flags to On and call the load routines on the tabclick event. But, I do not want to have the postback ON on the tabclick.
Make sense? For some reason I think the webtab is keeping the control from reloading even though the code behind is being run.
I am attaching a sample, where a WebDataGrid is placed in one tab and you can select rows by clicking buttons in another tab. Note that setting EnableAjax to true for the second tab will prevent the grid from updating when the buttons are clicked. Please take a look and let me know if this helps.
Nikolay,
Your example got me thinking and I finally figured out to put an updatepanel around my control and it worked.
I'm glad you solved your issue. If you have any other questions, please do not hesitate to ask.
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!