Unique key for tree nodes

I use an infragistics tree control and each node requires a unique key.  If a key is not provided it uses the node text which rapidly causes and exception.  What is the best way to create a key the will always be unique?
Who is Participating?
ladarlingConnect With a Mentor Commented:
Why not just sequence them in the order that they are added to the tree? That is, you could just declare:
Dim currentNodeID as Integer
NodeID +=1
Of course, that strategy may not work if you need to reference a node by ID without knowing the chronology of the adds. If that is likely, you may need to designate your own numbering scheme (much like a document outline.... roman numerals, with decimal children, which have alphabetic sub-children, and so forth).
Oops.. that would be
currentNodeID +=1
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.