set select tab in client side

2 posts, 0 answers
  1. appdev
    appdev avatar
    223 posts
    Member since:
    Sep 2008

    Posted 09 Jul 2009 Link to this post

    when i use a button click event to display content of tab 2 i must do 

    RadPage_Store.Selected = True for tab 2 content to display otherwise it woudln't display anything beside that tab2 is selected. so i was wondering what is the javascript code that equivalent to  RadPage_Store.Selected = True thank you, and why do i have to set 

     

    RadPage_Store.Selected = True inorder to have the content show up. thanks.

  2. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 16 Jul 2009 Link to this post

    Hello Duy,

    Here's a sample code snippet that shows the needed approach.

        <form id="form1" runat="server"
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        </telerik:RadScriptManager> 
     
        <script type="text/javascript"
            function selectTab() { 
     
                var tabstrip = $find('<%= RadTabStrip1.ClientID %>'); 
                tabstrip.get_tabs().getTab("1").click(); 
            }   
        </script> 
     
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"
            <Tabs> 
                <telerik:RadTab runat="server" Text="Root RadTab1"
                </telerik:RadTab> 
                <telerik:RadTab runat="server" Text="Root RadTab2"
                </telerik:RadTab> 
                <telerik:RadTab runat="server" Text="Root RadTab3"
                </telerik:RadTab> 
            </Tabs> 
        </telerik:RadTabStrip> 
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server"
            <telerik:RadPageView ID="RadPageView1" runat="server"
                RadPageView1</telerik:RadPageView> 
            <telerik:RadPageView ID="RadPageView2" runat="server"
                RadPageView2 
            </telerik:RadPageView> 
            <telerik:RadPageView ID="RadPageView3" runat="server"
                RadPageView3 
            </telerik:RadPageView> 
        </telerik:RadMultiPage><input id="Button1" type="button" value="button" onclick="selectTab()" /> 
        </form> 


    Kind regards,
    Paul
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top