Identify a TreeNode within a TreeView

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
 
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
 
Back
Top