No that doesn't work, because the nodes aren't sorted by as in the visual treeview in the collection. It would find the nodes in a weird order using the collection.
In these instances I use the Nodes collection in a For Each loop and a For Each to go through the collection. You do not loose much time by doing it this way.
for example. If I have a collection named g_Col Then I would work the situation as follows.
Dim oObj as <name of class in the collection>
dim nodX as node
for each nodX in tree1.nodes
for each oObj in g_Col
if oObj.identifier = nodX.key Then
'enter transactional code here.
end if
next
next
I only worry about how they are sorted in the tree. The sorting of the collection could be made asyncronous with the tree, but then you are taking extra steps. Remember that you can always access the parent and child nodes of the nodX that is it looking at by useing .parent or .child. That will also allow you to make sure you are looking at the right place.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.