This is a migrated thread and some comments may be shown as answers.

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

1 Answer 68 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
jgill
Top achievements
Rank 1
jgill asked on 24 Aug 2009, 10:20 PM
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)].

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 25 Aug 2009, 01:01 PM
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.
Tags
TabStrip
Asked by
jgill
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or