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
523
Hide Content Section
posted

I am trying to find a way to hide the content section based on what tab is selected.

Tab1  Tab2  Hide

So when Tab1/2 is clicked the content is shown, But clicking Hide hides the content section.  Currently I have nothing in the hide template but it still puts empty box where the content would be.  It there any property/style I can use to hide the content section?

  • 24497
    posted

    Hi Rob,

    Latest versions of WebTab should have boolean property VisibleContent. On client that property is available as set_visibleContent(bool).

    If your version of WebTab has that, then you may use something like below. Otherwise, you may consider to get latest service release for NetAdvantage.

    <script type="text/javascript">
    function WebTab1_SelectedIndexChanged(sender, eventArgs)
    {
     var hide = eventArgs.get_tabIndex() == 2;
     sender.set_visibleContent(!hide);
    }
    </script>
    <ig:WebTab ID="WebTab1" runat="server" Width="300px" Height="300px">
       <Tabs>
        <ig:ContentTabItem runat="server" Text="Tab 1">
        </ig:ContentTabItem>
        <ig:ContentTabItem runat="server" Text="Tab 2">
        </ig:ContentTabItem>
        <ig:ContentTabItem runat="server" Text="Tab 3">
        </ig:ContentTabItem>
       </Tabs>
       <ClientEvents SelectedIndexChanged="WebTab1_SelectedIndexChanged" />
    </ig:WebTab>