>Hello,
>
>I'm using the Treeview control (6) and I run into some problems when I need to change the order of nodes. What I'm doing now is, when the order needs to be changed, I reload the complete tree. but this can take quite some time when the number of nodes is high.
>Can I add nodes before/after a specific node?
>
>Thanks for your help in advance!
* First, the existing node must be removed:
oForm.oTree.nodes.Remove(lcNodeKey)
* Then it must be (re)added Ex:
oForm.oTree.Nodes.Add;(lcRelativeKey,lnRelationshiptorelativekey,lcDestinationKey,lcDestinationText,,)
It may be necessary to determine things like whether a parent node needs to be created. If this node is the first child node, or where the re-add fits into a seqence of "child" nodes.
You can use VARTYPE() and FindItem to determine if elements of your TreeView already exist.
Imagination is more important than knowledge