Identify a TreeNode within a TreeView

G

Guest

Is there any property within a TreeNode that uniquely identifies it against
all other TreeNodes with the TreeView? I'd like to "tag" several nodes
within a TreeView, and then later either add children nodes to them or delete
the nodes completely.
 
M

Mattias Sjögren

Is there any property within a TreeNode that uniquely identifies it against
all other TreeNodes with the TreeView? I'd like to "tag" several nodes
within a TreeView, and then later either add children nodes to them or delete
the nodes completely.

The Handle property should be unique, but I'm not sure it will help
you here. Can't you simply add references to the "tagged" nodes to
some kind of collection?


Mattias
 
C

Cryptik

You can add your own by putting something unique in the Node.Tag
property.

If your doesn't allow duplicate names on the same tree level you could
also try using Node.FullPath I suppose.

If you just want to keep a reference to that location to use in the
future to add additional items to, why not just save the item to your
own collection somewhere so you can access it again later?


Kelly S. Elias
Webmaster
DevDistrict - C# Code Library
http://devdistrict.com
 

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