• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1711
  • Last Modified:

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
0
stockman001
Asked:
stockman001
1 Solution
 
Vivek ThangaswamyCommented:
Hi

Hope this article may help you.
http://www.15seconds.com/issue/030827.htm
0
 
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

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now