>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!"