Treenode unique ID

M

Mark Goldin

In a web version of treeview control every node has a unique ID based on a
position of that node in the tree.
Is there something like this in a winform version of the control?

Thanks
 
H

Herfried K. Wagner [MVP]

* "Mark Goldin said:
In a web version of treeview control every node has a unique ID based on a
position of that node in the tree.
Is there something like this in a winform version of the control?

No. Even 'FullPath' sometimes isn't unique. Nevertheless you can store
an ID in the 'TreeNode''s 'Tag' property and/or store (key, 'TreeNode')
pairs in a 'Hastable'.
 
T

Tobin Harris

Mark Goldin said:
In a web version of treeview control every node has a unique ID based on a
position of that node in the tree.
Is there something like this in a winform version of the control?

I think there is a "FullPath" property, which should be unique to each tree
node (unless you have duplicate node text udner a single node?).

I used this in my TreeViewMemory class
(http://www.tobinharris.com/default.asp?id=11&mnu=11) which is designed to
allow you to save and restore the state of a tree in between clearing and
reloading it.

Cheers,

Tobin
 

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

Top