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

SiteMap and No Children

1 Answer 86 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Mark Rowe
Top achievements
Rank 1
Mark Rowe asked on 19 Aug 2008, 03:15 AM
Hello,

I'm using the Tabstrip with a sitemap as a datasource.  I would like to only show the top level pages on the tabstrip, which is simple if I did the MaxDataBindDepth = 1.  However, I have sort of a problem when doing that.

Let's use your example:
 <?xml version="1.0" encoding"utf-8" ?> 
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > 
<siteMapNode url="http://www.telerik.com" title="Telerik" description="Telerik home page"
<siteMapNode url="http://www.telerik.com/radcontrols" title="Telerik RadControls for ASP.NET" description ="Telerik RadControls for ASP.NET" > 
<siteMapNode url="http://www.telerik.com/radeditor" title="Telerik RadEditor" description="Telerik RadEditor control"/> 
</siteMapNode> 
<siteMapNode url="http://www.telerik.com/radnavigation" title="Telerik RadNavigation controls" description ="Telerik RadNavigation controls" /> 
</siteMapNode> 
</siteMap>  

What I want to happen is only show the Top Level Tabs, such as "Telerik RadControls for ASP.NET" and "Telerik RadNavigation controls".

But here is the problem...I want to still show that "Telerik RadControls for ASP.NET" is still highlighted when the person goes to the "Telerik RadEditor" (which is a child page).  If I set the MaxDataBindDepth = 1 I'm not getting that to work (and I probably know why).

Is there an easy way to eliminate all the children, while also using the sitemap to know what top level tab you are in?

Thanks

1 Answer, 1 is accepted

Sort by
0
Mark Rowe
Top achievements
Rank 1
answered on 19 Aug 2008, 02:34 PM
This is what I ended up doing.

NavigationTabStrip.DataSourceID = SiteMapDataSource1.ID 
NavigationTabStrip.DataBind() 
For Each navtab As RadTab In NavigationTabStrip.Tabs 
    If navtab.Tabs.Count > 0 Then 
             navtab.Tabs.Clear() 
        End If 
    Next 

Thanks
Tags
TabStrip
Asked by
Mark Rowe
Top achievements
Rank 1
Answers by
Mark Rowe
Top achievements
Rank 1
Share this question
or