Click to See Complete Forum and Search --> : TreeView Sort bug ?
bluesyvivek
June 14th, 2001, 04:36 AM
after sorting a treeview when we loop through the nodes in code it still follows the original order!!!! any way around it....
I need to sort the treeview and process in the sorted order...help
vivek
Isaacson
June 14th, 2001, 04:27 PM
What do you mean by "sort"?
Do you mean Node.Sorted = True
-OR-
do you have some of your own sorting code?
if you have a Node.Sorted = True issue
and want the child nodes in sorted order try something like
set Nodx = NodeYouSorted.Child
set Nodx = Nodx.FirstSibling
Do While Not (Nodx Is Nothing)
' we should be moving through the nodes in ascending order now
List1.AddItem Nodx.Text & " " & Nodx.Index
Set Nodx = Nodx.Next
Loop
The FirstSibling and Next syntax will give you a top down output
of what you see displayed.
bluesyvivek
June 15th, 2001, 03:51 AM
thanks.
Sorted=true,yes.
It doesnt work if i use a...
For each node in tree.nodes
next
vivek
Isaacson
June 15th, 2001, 09:34 AM
The problem with the
For each node in tree.nodes
next
syntax is that it's order is set by the Nodes collection in the tree, and will most likely look like the order the Nodes were added to the Tree.
How many levels deep is your tree?
It seems that if you want ALL of the Nodes to be part of the sort, that
a one level deep tree would work for you, more like a List.
Please email me with info/comments, I'll be happy to help.
disaacson@novadigm.com
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.