ASP.NET 2.0 Treeview Sitemap with multiple top level nodes

Posted on 2006-04-18
Last Modified: 2010-08-05
Hello Experts,

I have a treeview bound to a sitemap in 2.0.  Due to the fact that this bound to an XML file it has only one toplevel node, allowing the user to collapse the entire menu.  I would like to have multiple top level nodes so the user can only collapse the menu to a certain level.  I am looking for the cleanest way to accomplish this.  

Thank you,

Question by:dukestaTAI
    LVL 12

    Expert Comment

    interstingly I have the same issue,
    I beleive that xml can only have 1 root level node and the sitemap links directly onto this root level.
    maybe have 2 site maps and 2 treeviews - this does seem like a bad solution though
    LVL 4

    Author Comment

    I have read something about using XPath but don't really know much about this.  Are you familiar with this?
    LVL 4

    Author Comment

    I found the answer, it was pretty simple too.  There is an option in the siteMapDataSource:


    This eliminates the top level node from being displayed.

    Moderator please refund points.
    LVL 4

    Author Comment

    I requested the points to be refunded almost a month ago so i agree with the recomendation.

    Accepted Solution

    PAQed with points refunded (500)

    Community Support Moderator

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    I have developed many web applications with asp & and to add and use a dropdownlist was always a very simple task, but with the new, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video discusses moving either the default database or any database to a new volume.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now