Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Treeview Problem
Message
De
02/04/2003 19:13:39
 
 
À
01/04/2003 21:49:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00772794
Message ID:
00773350
Vues:
12
Hi Andy.

How can I fix this. Do I have to clear the tree view nodes and reload the tree view ? (how and what is the quickest way to reload the tree view) Or is there an easier way?

Did you not get my e-mail?

What you could do is to determine where the new node belongs by constructing the node key for the sibling node that preceded it (unless it is the first record in the table based on the table's index order). Something like this ( untested ) after you add the record that the node represents to the table (I assume that you are adding the record to the table before you add the node to the tree):
INSERT INTO Company ( CompanyName ) VALUES ( 'Fred FlintStone' )
IF TABLEUPDATE( 0, .F., 'Company' )
  *** Construct the node for the new record
  lcKey = 'COMPANY*' + TRANSFORM( CompanyID )
  *** Find out where this node belongs
  SKIP -1 in Company
  IF BOF( 'Company' )
    *** Insert it in front of all the other nodes	
    Thisform.oTree.Nodes.Add( , tvwFirst, lcKey, Company.CompanyName )
  ELSE
    lcSiblingKey = 'COMPANY*' + TRANSFORM( CompanyID )
    Thisform.oTree.Nodes.Add( lcSiblingKey, tvwNext, lcKey, Company.CompanyName )
  ENDIF
ENDIF
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform