Information générale
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Network:
Windows 2000 Server
>thnx all for your help, i have made the node with the help of cetins example. Starting with a dbf of 1600000 records in combination of other files i managed to make one cursor that contains all info i need to build my treeview. my final cursor contains 66130 records. Building the cursor takes the pc max 10 seconds. putting the info 66130 records takes me 50 seconds.
>
>this is my code :
>
>SCAN
>IF empty(mercedes_treeview.parentID)
>.Nodes.add(,tvwFirst,alltrim(mercedes_treeview.nodeID),ALLTRIM(mercedes_treeview.nodeText))
>ELSE
>.Nodes.add(alltrim(mercedes_treeview.parentID),tvwChild,alltrim(mercedes_treeview.nodeID),ALLTRIM(mercedes_treeview.nodeText))
>ENDIF
>ENDSCAN
>
>Does somebody knows how i can speed up the building of the treeview ?
Don't build all the nodes at once, but only on demand. Build the root nodes and add a dummy child node to each on startup. On the expand event of a node, determine if it has child that is a dummy node (means that it has not been built yet) -- you can use a special key value to indicate that it is a dummy node (maybe prefix with a 'D'). If a dummy node, then delete the node and add the real nodes (each added node then has its own dummy child node also added).
This way only a few nodes are added at a time -- the performance to the user then is good.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement