943,926 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 1638
  • ASP.NET RSS
Jan 30th, 2008
0

TreeView Web Control

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Corna is offline Offline
7 posts
since Jan 2008
Feb 8th, 2008
0

Re: TreeView Web Control

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Corna is offline Offline
7 posts
since Jan 2008
Feb 8th, 2008
0

Re: TreeView Web Control

you may try :::

treeid.CollapseAll();
Reputation Points: 10
Solved Threads: 0
Light Poster
u4umang2001 is offline Offline
28 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: can we pass parameter to trigger?
Next Thread in ASP.NET Forum Timeline: i need help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC