How to change progmatically active Tab in RadTabStrip/RadMultiPage?

10 posts, 0 answers
  1. Mike
    Mike avatar
    24 posts
    Member since:
    Feb 2008

    Posted 21 Jan 2010 Link to this post

    Hello All,
    I use a lot Tabs (with RadTabStrip/RadMultiPage) in our WebApplication and I have situations where program logic in codebehind should change active Tab in RadTabStrip.

    I have tried C# code like RadTabStrip.SelectedIndex = index but it doesn't seem to work.
    I have also tried to activate tab calling Javascript from codebehind but doesn't succeeded.
    Every time when I have progmatically tried to change active Tab page has started to work quite peculiar.
    It either freeze or content doesn't change at all.

    Tabbed pages have following structure:
         RadPageView (Multiple RadPageViews)
           UI Controls like RAdTextBoxes etc.

    Can anyone tell how to activate Tab using C# or Javascript:


    <telerik:RadTabStrip ID="RadTabStrip1" runat="server"   
       MultiPageID="RadMultiPage1" SelectedIndex="0"   
          <telerik:RadTab TabIndex="0" Text='Organization' PageViewID="RadPageViewOrganizationSearch"/>  
          <telerik:RadTab TabIndex="1" Text='Person' PageViewID="RadPageViewPersonSearch"/>  
          <telerik:RadTab TabIndex="2" Text='Ext.Search' PageViewID="RadPageViewExtendedSearch"/>  
          <telerik:RadTab TabIndex="3" Text='Lists' PageViewID="RadPageViewDistributionListSearch"/>  
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" BorderColor="Gray"   
       BorderStyle="Solid" BorderWidth="1px" Width="600px" SelectedIndex="0">  
       <telerik:RadPageView runat="server" ID="RadPageViewOrganizationSearch" Selected="true">  
          <table id="Table1" runat="server" width="600px">  
                <td colspan="2">  
                   <table class="ms-disc-bar" width="100%">  
                            <asp:Label ID="Label2" CssClass="ms-standardheader" runat="server"   
                               Text='Organization Values'/>  
                <td class="ms-formlabel" style="width: 125px">  
                   <asp:Label ID="Label9" CssClass="ms-standardheader" runat="server"   
                <td class="ms-formbody">                             
                   <telerik:RadTextBox ID="RTBName" runat="server">  

  2. Mark Galbreath
    Mark Galbreath avatar
    171 posts
    Member since:
    Jul 2009

    Posted 21 Jan 2010 Link to this post

    radTabStrip1.Tabs.Item( 2 ).Selected = True 
    radMultiPage1.SelectedIndex = 2 
    works for me....

  3. Sai
    Sai avatar
    5 posts
    Member since:
    Aug 2011

    Posted 11 Nov 2011 Link to this post


    I am having some issue with RabTabStrip.

    1. I have default .aspx page which contains RadTabStrip and multipageview controls.
    2. I am binding the tabs (Tabs – My Form, Form, Admin etc) and pageviews dynamically  in default.aspx page
    3. When I click on the 1st tab I am viewing the page1 ( myform.aspx ) and selected tab index = 0
    4. I am navigating to another page from myform.aspx to form.aspx page using hyperlink control.


    1. I need to change the active tab from my form to form of TabStrip which is in Default.aspx from my form to form when I navigate to form.aspx from myform.aspx
    2. I have tried to access tab control by creating the instance of default.aspx in the form.aspx, but the objects is always returning null.

    I hope you understand the problem I am facing. I would be grateful, if you can proved me some kind solution to resolve this issue. An early reply with solution is highly appreciated.



  4. Kate
    Kate avatar
    1898 posts

    Posted 16 Nov 2011 Link to this post

    Hi Sai,

    I am not quite sure that I understand your scenario. However, I assume that you are not able to find the relevant tab of the RadTabStrip control. I would suggest that you use one of the properties described in this help article to find the needed tab. In case this does not help can you elaborate on your scenario and provide some sample code that will help us reproduce it?

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  5. Siva
    Siva avatar
    1 posts
    Member since:
    Mar 2014

    Posted 26 Mar 2014 Link to this post

  6. Vinay
    Vinay avatar
    1 posts
    Member since:
    Sep 2012

    Posted 04 Nov 2014 in reply to Mark Galbreath Link to this post

    Its a good post. Its working for me...
  7. ldejesusvega
    ldejesusvega avatar
    1 posts
    Member since:
    Mar 2015

    Posted 24 Apr 2015 in reply to Mark Galbreath Link to this post

    radMultiPage1.SelectedIndex = 2  

    this line solve my problem...

  8. Tarun
    Tarun avatar
    1 posts
    Member since:
    Jul 2015

    Posted 06 Jul 2015 in reply to Kate Link to this post

    I have a 3 image buttons and 3 tabs and page views and one javascript function. below is the code sample

     <script type="text/javascript"> 

     function imgclick(a) {
           // alert(a);      
            var multiPage = $find("<%=RadMultiPage1.ClientID %>");
            if (a == "1")
                var pageView = multiPage.findPageViewByID("RadPageView1");
            if (a == "2")
                var pageView = multiPage.findPageViewByID("RadPageView2");
            if (a == "3")
                var pageView = multiPage.findPageViewByID("RadPageView3");

            if (pageView)


      <img src="/images/donor-icon.png" alt="" onclick="javascript:imgclick('1')" />

      <img src="/images/donor-icon.png" alt="" onclick="javascript:imgclick('2')" />

      <img src="/images/donor-icon.png" alt="" onclick="javascript:imgclick('3')" />


    <telerik:RadTabStrip runat="server" ID="RadTabStrip1" MultiPageID="RadMultiPage1" SelectedIndex="1" >
                <telerik:RadTab Text="Marks="True" PageViewID="RadPageView1"></telerik:RadTab>
                <telerik:RadTab Text="Profile" PageViewID="RadPageView2"></telerik:RadTab>
                <telerik:RadTab Text="Address" PageViewID="RadPageView3"></telerik:RadTab>


     <telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0">
            <telerik:RadPageView runat="server" ID="RadPageView1">
         <telerik:RadPageView runat="server" ID="RadPageView2">

         <telerik:RadPageView runat="server" ID="RadPageView3">

     My requirement is whenever the user clicks on the image button i need to show that tab in the RadTab. suppose if the user clicks on the second iamge button i have show the second tab. i tried this bu using the above client side java script function, but not works. Can you please help me in this regards.





  9. Nencho
    Nencho avatar
    1785 posts

    Posted 09 Jul 2015 Link to this post

    Hello Tarun,

    The closing parenthese is missing from the demonstrated javascript implementation, which is causing an error and might corrupt the proper behavior for changing the active PageView. However, you would need to implement the same logic for changing the active Tab as well.

    In the attachment you can find a simple example on how this should be achieved.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  10. Bill Noble
    Bill Noble avatar
    25 posts
    Member since:
    Sep 2003

    Posted 03 Mar 2017 in reply to Mark Galbreath Link to this post


    Works for me also

Back to Top