Hello...
As active a method or event in c # when clicking on one of the selected tab of a Webtab v11.2 and later display several different controls or usercontrols in each ContentTabItem.
Similarly us and if there is another way to validate the contents of a ContentTabItem by text or key.
This is my code
Markup
<ig:WebTab ID="WebTab1" runat="server" Height="700px" Width="700px"> <Tabs> <ig:ContentTabItem runat="server" Key="tab1" Text="Tab 1"> </ig:ContentTabItem> <ig:ContentTabItem runat="server" Key="tab2" Text="Tab 2"> </ig:ContentTabItem> <ig:ContentTabItem runat="server" Key="tab3" Text="Tab 2"> </ig:ContentTabItem> </Tabs> </ig:WebTab>
And here not add me to all controls ContentTabItem
Codebehind
System.Web.UI.WebControls.Label l1 = new System.Web.UI.WebControls.Label(); System.Web.UI.WebControls.TextBox t1 = new System.Web.UI.WebControls.TextBox(); System.Web.UI.WebControls.DropDownList d1 = new System.Web.UI.WebControls.DropDownList();
foreach (ContentTabItem tab in web3.Tabs) {
switch (tab.Text) { case "Tab 1": tab.Controls.Add(t1); tab.Controls.Add(d1); tab.Controls.Add(l1); break; case "Tab 2": tab.Controls.Add(d1); break; case "Tab 3": tab.Controls.Add(t1); break; } }
In advance thank you very much
Hello Mary,
A control's instance can't appear in more than one place, you would need to create another instance of these controls if you want them all to show in the first tab and in the other tabs as well.
Another way would be to hide and show the control in the different tabs on changing the index.
Does the above help you?
I will be happy to assist you further on this.
Hello Boris Toromanov
And will that I can call or invoke an event c # codebehind this with my clientEvents the client side something like this:
<ClientEvents SelectedIndexChanged = "WebTab1_ActiveTabChange" />
while the codebehind
private void WebTab1_ActiveTabChange (object sender, Infragistics.Web.UI.LayoutControls.TabSelectedIndexChangedEventArgs e) {
// validate each selected tab }
Or this can only be done with javascript
I appreciate your help
If you want both the client-side and server-side events to fire, you would need to do the following:
function WebTab1_SelectedIndexChanged(sender, eventArgs){ return true;}
<ig:WebTab ID="WebTab1" runat="server" Height="200px" Width="300px" EnableActivation="True" OnSelectedIndexChanged="WebTab1_SelectedIndexChanged"> <ClientEvents ActiveTabChange="WebTab1_ActiveTabChange" SelectedIndexChanged="WebTab1_SelectedIndexChanged" /> <AutoPostBackFlags SelectedIndexChanged="On" />
Code behind:
protected void WebTab1_SelectedIndexChanged(object sender, Infragistics.Web.UI.LayoutControls.TabSelectedIndexChangedEventArgs e) {
}
I appreciate your attentionIt was what I needed
Hello Mary Garcia,
I am really glad to hear this. Please do not hesitate to contact us here or through a support request (case) in the future.