Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Nodes order in treeview
Message
 
À
12/10/2000 10:54:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00428492
Message ID:
00429070
Vues:
13
First thing you may need to do is get to the topmost ROOT node. Then you need to know if the root has children. Then you may need to know if there are grandchildren (and so on). Since the INDEX of the nodes may not imply (or correspond to) the position of the node in the TreeView you might test for the prospective NEXT NODE type by evaluating its existance as an Object. Note: When adding nodes, be sure include the KEY reference

.. to point to a specific node you might ..
MyForm.MyTreeView.Nodes(some pointer string).Selected=.T. && " Some pointer string" matches the 'KEY' as per Add()

.. To refrence the current node
lcCurrentNodeKey=MyForm.MyTreeView.SelectedItem.key && This is where you are now

.. then, see if the current node has a child, or sibling, etc;
if vartype(MyForm.MyTreeView.Nodes(lcCurrentNodeKey).child=="O" && Then the current node has a child

.. to assess if current node is last node in tree, you might ..
if NOT vartype(MyForm.MyTreeView.Nodes(lcCurrentNodeKey).Next=="O" && Then current node is last
.. and so on.

We also have LASTSIBLING, FIRSTSIBLING, SIBLING, PARENT and others
HTH:

>Hi All,
>
>Is it possible to access the nodes as per their order in the treeview? For example I have following data in a treeview:
>
>1
>	4
>	5
>	6
>		12
>		13
>	9
>2
>3
>	7
>	8
>		10
>	11
>14
>
>
>If I use the below code:
>
With oTreeView
>	For i = 1 To .Nodes.Count
>		?.Nodes(i).Key
>	EndFor
>EndWith
>
>the output is 1, 2, 3, 4, 5, 6 ..... 14
>
>But, I want the output to be
>1, 4, 5, 6, 12, 13, 9, 2, 3, 7, 8, 10, 11, 14
>
>TIA for your help.
>
>Regards
>Vijay
Imagination is more important than knowledge
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform