I can't figure how to populate the leafs in a Treeview as in the code below. The index is usually derived from the SelectedItem, but we don't have one yet. Can anyone help
SELECT Phone
SET ORDER TO Customer
SCAN
*// Add each name to a node
thisform.treeview1.nodes.add(,2,phone.code,phone.name,,0)
*// Add transactions for this customer
SELECT docket
SET ORDER TO Custcode
SET EXACT ON
IF SEEK(phone.code)
SCAN REST WHILE custcode = phone.code
cStr = TRANSFORM(docket.amount,"99999999.99")+docket.transdesc
*// Oh how to reference the node we have just added and make sure this leaf belongs to the parent ?
*// Usually get this from the SelectedItem
nWhatGoesHere = 1
Thisform.treeview1.nodes.add (nWhatGoesHere,4,,cStr,,0)
ENDSCAN
ENDIF
SELECT Phone
ENDSCAN
To move a mountain start with the smallest stone