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

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:
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.treeview.aspx

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.

Thanks,
Dan
stockman001Asked:
Who is Participating?
 
Ajay SharmaCommented:
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>";

}
</script>

0
 
Vivek ThangaswamyCommented:
Hi

Hope this article may help you.
http://www.15seconds.com/issue/030827.htm
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.