Assosiate an ID with a tree view node

  • Thread starter Thread starter Martin
  • Start date Start date
M

Martin

Hi,

I am populating a tree view in vb.net. I would like to ask if there is a way
for the treeview node to have a "hidden" ID asssoiated with it.

when the user clicks on the node a wish to go away to a database and look a
record up based on this "hidden" ID.

The text of the node will not do for this purpose as it is not unique
enough.


thanks in advance for any help that can be offered.

cheers

martin.
 
* Martin said:
I am populating a tree view in vb.net. I would like to ask if there is a way
for the treeview node to have a "hidden" ID asssoiated with it.

when the user clicks on the node a wish to go away to a database and look a
record up based on this "hidden" ID.

You can store the ID in the 'TreeNode''s 'Tag' property.
 
You *could* use the tag but an OO approach would see you using a class
derived from TreeViewItem.You could then add this and any other [unexpected]
property to that class.
 
Back
Top