Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Order of nodes in Treeview
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00530418
Message ID:
00531005
Views:
13
This message has been marked as a message which has helped to the initial question of the thread.
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform