We want to enable/disable all the tabs except the one the user is working on, based on conditions at runtime.
To simply illustrate the problem we're having, I created a webtab with a button on Tab[0]. In the Click event handler for the button, I coded
WebTab1.Tabs[1].Enabled = false;
When WebTab1.PostBackOptions.EnableAjax is set to false, this works; when set to true, it does not. I tried setting all the various other PostBackOptions, and I tried this:
WebTab1.Tabs[1].GetUpdatePanel(true).Update();
to manually force a refresh. I also look for other properties or methods of the webtab and the contenttabitem classes, but nothing looked promising.
It seems I can disable controls inside the ConentPanes of the tabs just fine, but I cannot affect the webtab itself or the tabs collection.
Can anyone help? Thanks.
-BillyB
Hello Billy,
This happens because when the property EnableAjax is true, then not all the data regarding the grid is transfered to the server and back.
You may disable the second tab but this information is not transitioned to the client and therefore the WebTab is not refreshed (you can check the data transitioned by the server in the response if you use Firebug or similar tool).
I recomend you to disable the tab on client side ,if you want to get advantage of the AJAX funcionality. For example :
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" OnClientClick="setDisabled();" />
function setDisabled() {
var tab = $find("<%=WebTab1.ClientID %>");
tab.get_tabs()[1].set_enabled(false);
}
Let me know if you need further assistance regarding this.
That worked, of course. We were making a trip to the server anyway and needed some server-side data in order to make the enable/disable decision, so we wanted to do it all server-side.
I can see that you guys don't want to transport a lot of data back and forth on partial postbacks, but it seems like a lot of folks would want to do this when Ajax is turned on, and IG is, after all, creating a server side control and can access the the rendering code to render certain things. Where do I make a feature request? I looked and couldn't find any place on the forums
anyway, thanks!