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:
00840674
Views:
20
This message has been marked as the solution to the initial question of the thread.
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform