468,103 Members | 1,255 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,103 developers. It's quick & easy.

Tree View for Non-Navigational Purposes

I have generated a nice tree view that displays some otherwise cyptic XML in
an easy to follow manner. The trouble is that the TreeView assumes that I'm
wanting a link in each of the nodes, and I really just want to display them
for view only. How can I disable the link-ness of the data in the tree view?
I have tried setting the target of the links to "javascript:false;" but it
still causes a postback and flashes the page to the top destroying my scroll
position.

Am I missing something?
Mar 19 '06 #1
2 1189
Set the NavigateUrl property of the TreeNode to an empty string:

"The text of a node in the TreeView control can be in one of two modes:
selection mode or navigation mode. By default, a node is in selection mode.
To put a node into navigation mode, set the node's NavigateUrl property to a
value other than an empty string (""). To put a node into selection mode, set
the node's NavigateUrl property to an empty string."
http://msdn2.microsoft.com/en-us/lib...de(VS.80).aspx

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"dave.dolan" wrote:
I have generated a nice tree view that displays some otherwise cyptic XML in
an easy to follow manner. The trouble is that the TreeView assumes that I'm
wanting a link in each of the nodes, and I really just want to display them
for view only. How can I disable the link-ness of the data in the tree view?
I have tried setting the target of the links to "javascript:false;" but it
still causes a postback and flashes the page to the top destroying my scroll
position.

Am I missing something?

Mar 20 '06 #2
haha, thanks. I always go making things difficult. (I had started to look for
more elaborate things like overriding the render method) figures it something
simple.

"Phillip Williams" wrote:
Set the NavigateUrl property of the TreeNode to an empty string:

"The text of a node in the TreeView control can be in one of two modes:
selection mode or navigation mode. By default, a node is in selection mode.
To put a node into navigation mode, set the node's NavigateUrl property to a
value other than an empty string (""). To put a node into selection mode, set
the node's NavigateUrl property to an empty string."
http://msdn2.microsoft.com/en-us/lib...de(VS.80).aspx

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"dave.dolan" wrote:
I have generated a nice tree view that displays some otherwise cyptic XML in
an easy to follow manner. The trouble is that the TreeView assumes that I'm
wanting a link in each of the nodes, and I really just want to display them
for view only. How can I disable the link-ness of the data in the tree view?
I have tried setting the target of the links to "javascript:false;" but it
still causes a postback and flashes the page to the top destroying my scroll
position.

Am I missing something?

Mar 20 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Tree menu using XML | last post: by
1 post views Thread by Jesper DK | last post: by
4 posts views Thread by David W. Simmonds | last post: by
10 posts views Thread by dwok | last post: by
6 posts views Thread by Kishor | last post: by
6 posts views Thread by Robin Tucker | last post: by
3 posts views Thread by Stefan Schwarzer | last post: by
3 posts views Thread by gmail | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.