Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding nodes to a treeview from a table
Message
From
09/01/2007 16:26:20
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Adding nodes to a treeview from a table
Environment versions
Visual FoxPro:
VFP 6
Miscellaneous
Thread ID:
01183973
Message ID:
01183973
Views:
62
Any neat code to add the nodes for a treeview using a foxpro table? In this table I have the relative, relation and ckey, so I'd know the order of my treeview.

And where to put this in the form?

Currently I have the code below to add nodes from a table, and I placed it in my form's activate. Is this right?
sele treeview
=tableupdate(.t.)
go top
o = thisform.oletreeview.nodes
o.clear

scan
	if alltrim(crelative) == '0'
		o.add(,1,alltrim(ckey),alltrim(ctext),0)
	else
		o.add(alltrim(crelative),4,alltrim(ckey), alltrim(ctext),0)
	endif
endscan
In my form I have a simple add node button that adds a record to a table. Since I want my treeview to somewhat refresh (get the updated values of my table), I placed the code in the form's activate.

Can you help me refine this code pls?

Thanks.
Next
Reply
Map
View

Click here to load this message in the networking platform