TreeView Web Control

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2008
Posts: 7
Reputation: Corna is an unknown quantity at this point 
Solved Threads: 0
Corna Corna is offline Offline
Newbie Poster

TreeView Web Control

 
0
  #1
Jan 30th, 2008
Hi,

I have a treeview control with a sitemap datasource which I use for a menu on a masterpage. All works fine, but I would like to:
1. Have all items collapsed at startup
2. Only expand the node selected and not all nodes when user click on a node
3. Be able to expand the node when click on the description as well as on the image.

Did I miss a few properties?
Please help.
Thanx
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 7
Reputation: Corna is an unknown quantity at this point 
Solved Threads: 0
Corna Corna is offline Offline
Newbie Poster

Re: TreeView Web Control

 
0
  #2
Feb 8th, 2008
I found the following:

If you set the ExpandDepth = 0 all nodes are collapsed at startup, but then for every click all nodes are collapsed again. Which is better than to have the entire tree expanded on every click. (I added a sitemappath at the top of the page to show where exactly you are in the treeview). Secondly, to be able to expand a node when you click on the description added the following code:

protected void tvMenuNode_DataBound(Object sender, TreeNodeEventArgs e)
if (e.Node.NavigateUrl == "")
{
e.Node.SelectAction = TreeNodeSelectAction.Expand;
}

}

I still need to find a way to keep the selected node expanded.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 28
Reputation: u4umang2001 is an unknown quantity at this point 
Solved Threads: 0
u4umang2001's Avatar
u4umang2001 u4umang2001 is offline Offline
Light Poster

Re: TreeView Web Control

 
0
  #3
Feb 8th, 2008
you may try :::

treeid.CollapseAll();
Thanks & Regards
Umang
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC