Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
355
Validate ContentTabItem selected from the codebehind of a Webtab v11.2
posted

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




Parents
  • 71886
    Verified Answer
    Offline posted

    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.

Reply
  • 355
    posted in reply to [Infragistics] Boris Toromanov

    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

Children