Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting child nodes in a treeview
Message
 
To
02/05/2001 13:54:22
Héctor Lizarraga
Gobierno Del Edo de Querétaro
Querétaro, Mexico
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00502654
Message ID:
00502772
Views:
15
>Hi all, I have a treeview wich I fill with the routine that comes with the treeview samples. When I delete a node there's no problem but when the node have childrens (If oTreeView.SelectedItem.Children > 0), how can i loop throughout the key's child nodes. I have this:
>
>nIndice = oMenu.SelectedItem.FirstSibling.Index
>Do While nIndice <> oMenu.SelectedItem.Node.LastSibling.Index
> DELETE FROM DRH_Menu WHERE DRH_Menu.Key = oMenu.Nodes(nIndice).Next.Key
> nIndice = oMenu.Nodes(nIndice).Next.Index
>Enddo
>oMenu.Nodes.Remove(oMenu.SelectedItem.Key)
>TABLEUPDATE(0, .T., 'DRH_Menu')
>
>The thing is that deleting the node in the treeview is no problem even with children below it, but i need to match the teeview key's node with my nodes table. How can i do this?
>
>Thanks in advance
>Hector L.

Maybe this can help. Use the PARENT property. you select the parent node, and do your while based on the PARENT property. if the node parent key (oMenu.SelectedItem.Node.PARENT.KEY) is the key you want, delete the current node (oMenu.SelectedItem.Node).

HTH

Alonso.
Like Frank said: "I did it... MY WAY!"
Previous
Reply
Map
View

Click here to load this message in the networking platform