Tree View:  "Expand All" and "Collapse All" functionality to show/hide content

Posted on 2007-10-21
Last Modified: 2013-11-19
How does MSDN program the main frame to "Expand All" and "Collapse All" the content?

How do they get the content into the Tree View?

Is this even using Tree View Class to do this?

Here is a link to the TreeViewClass:

I figured out how to pull a treeview from a database, but can't figure out how to get the page content into the leaf nodes.

Question by:stockman001
    LVL 11

    Expert Comment

    by:Vivek Thangaswamy

    Hope this article may help you.
    LVL 18

    Accepted Solution

    You can use javascript to do this.

    Make a DIV tag in the right side of page, name it DivMain.

    Then on the tree node click u can call a javascript method to fill the DIV tag with the desired page.

    In the tree node generation put this method
    treenode1.Attributes.Add("OnClientClick ", "loadPage(""something.aspx"",""680"",""400"");")


    put this code in the head tag :
    <script language="javascript">
         function loadPage(url,wid,hig)
          document.getElementById('DivMain').innerHTML = "<iframe allowtransparency='true'  src='"+url+"' frameborder='no' width='"+wid+"' height='"+hig+"'></iframe>";



    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
    The viewer will learn how to count occurrences of each item in an array.
    Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

    755 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

    17 Experts available now in Live!

    Get 1:1 Help Now