Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Treeview control - tracking status
Message
 
À
26/05/2014 12:48:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01600699
Message ID:
01600715
Vues:
78
This message has been marked as the solution to the initial question of the thread.
>Worked out how to do it using the treeview.nodes.selected property.
>
>BS
>
>I have a treeview control on a form which I want the user to be able to move items up and down in the node listing one row at a time (i.e.not to a parent node, simply within its own parent node). I have achieved this OK by the use of 2 command buttons (one UP and one DOWN), but in order to get the treeview to display correctly I have to reload the underlying data. In doing so the tree view collapses to the main nodes and the user has to drill back down through the nodes to see if the move has worked (which it has!) and if necessary, move it again as required.
>
>Is there any way to save the status of the treeview prior to refreshing it and then getting VFP to put the tree back to that state, albeit with the entries in different line positions.
>
>I hope I explained that clearly enough....not easy to put into words what I am trying to achieve visually.
>
>Thanks
>Barry Sutton.


Save the key of the node you move.
After refreshing TreeView make this node SelectedItem and make sure that it is Expanded and Visible:
*** Move Up and Down
lcNodeKey = thisform.TreeView.SelectedItem.Key
*** Refresh TreeView
thisform.TreeView.SelectedItem = thisform.TreeView.Nodes(lcNodeKey)
thisform.TreeView.SelectedItem.EnsureVisible()
thisform.TreeView.SelectedItem.Expanded = .t.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform