Tree View for Non-Navigational Purposes

G

Guest

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?
 
G

Guest

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/library/system.web.ui.webcontrols.treenode(VS.80).aspx
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top