How To Select The First Tab In The Deepest Level of The Tabstrip

2 posts, 0 answers
  1. jgill
    jgill avatar
    116 posts
    Member since:
    Jul 2005

    Posted 24 Aug 2009 Link to this post

    I recently posted this question in the ASP.NET Classic Controls forum, http://www.telerik.com/community/forums/aspnet/tabstrip/select-first-child-tab-in-tabstrip.aspx, since the problem was similar, but in case those forums are not checked/updated (and since I am using the newer set of ASP.NET AJAX Q3 2009 controls) I am reposting here.

    I have a hierarchical RadTabStrip that is databound through a SqlDataSource.  I am trying to set up a "fallback" default scenario where if the FindByURL method does not find a match that the RadTabStrip defaults to the selecting the "deepest" value of the first tab.

    For example, assume that FindByURL could not find a matching tab in the items below.  By default I would like Parent1GrandChild1 selected if the tabstrip has a 3 level hierarchy.  I would like Parent1Child1 to be selected if the tabstrip has a 2 level hierarchy, and Parent1 selected if it only has root level tabs.  I do not know how to always select the first tab item in the deepest level of the tabstrip.


    Parent1                Parent2
    Parent1Child1        Parent2Child1    Parent2Child2
    Parent1Grandchild1    Parent1Grandchild2 


    I also need to do this in the codebehind instead of the clientside script on page load and am using RadControls for ASP.NET AJAX [Version: 2009.2 701 (Jul 1, 2009)].
  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 25 Aug 2009 Link to this post

    Hi jgill,

    I have already replied to that forum post:

             RadTab tabToSelect = RadTabStrip1.Tabs[0];  
            while (tabToSelect.Tabs.Count > 0)  
            {  
                tabToSelect = tabToSelect.Tabs[0];  
            }  


    Sincerely yours,
    Veselin Vasilev
    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