Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help loading a treeview from segmented data
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00840653
Message ID:
00840685
Views:
18
Niel,
If the cycles are fast, a SYS(2015) might try to add a duplicate node (on some OS's it's 1/100 seconds to change and on NT and XP it's 1/1000.

Also, would it be helpful to use field values as node keys to facilitate pointing back to a table record?


>Kirk,
>
>Once you have a node object reference you can use this directly instead of the key string as illustrated in the simple code below.
>
>LOCAL lnTotalNodes
>LOCAL lnCurrentField
>LOCAL loParent
>
>LOCAL ARRAY laSource[2]
>
>laSource[1] = "PID|FIELD1DATA|FIELD2DATA"
>laSource[2] = "IN1|IN1FIELD1DATA|IN1FIELD2DATA"
>
>lnTotalNodes = alen(laSource, 1)
>
>for lnOuterNode = 1 to lnTotalNodes
>   lnFieldCount = getwordcount(laSource[lnOuterNode], "|")
>
>   loParent = ThisForm.oleTree.Nodes.Add(, 1, sys(2015), ;
>                                         getwordnum(laSource[lnOuterNode], 1, "|"), ;
>                                         0, 0)
>
>   loParent.Tag = getwordnum(laSource[lnOuterNode], 1, "|")
>
>   for lnCurrentField = 2 to lnFieldCount
>      ThisForm.oleTree.Nodes.Add(loParent, 4, sys(2015), ;
>                                 getwordnum(laSource[lnOuterNode], lnCurrentField, "|"), ;
>                                 0, 0)
>   endfor
>endfor
>
>
>If you are getting no errors then check the LineStyle property as the nodes may be correctly created but the treeview is not giving you a visual indication (+) that the root nodes have siblings, this need to be set to 1 (Rootlines).
>
>HTH
>Neil
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform