Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to populate Treeview 6.0
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00315348
Message ID:
00315354
Vues:
37
Hi John,

The changes I've made in your code below should work (note I've not tested them - I'm working from memory)

The trick is that you can use wither the index (numeric) or the key (string) of the node in the Nodes.Add() method.

Cheers,

Andrew

>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

	Thisform.treeview1.nodes.add (Phone.Code,4,"DOC" + tran(docket.ID),cStr,,0)
	ENDSCAN
ENDIF

SELECT Phone
ENDSCAN
NB - I've assumed that there's a unique ID for the docket in a field called docket.ID


If we were to introduce Visual FoxBase+, would we be able to work from the dotNet Prompt?


From Top 22 Developer Responses to defects in Software
2. "It’s not a bug, it’s a feature."
1. "I thought I fixed that."


All my FoxTalk and other articles are available on my web site.


Unless specifically identified otherwise, anthing posted here is purely my opinion and may or may not reflect the policies or practices of Microsoft.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform