Good day
I was hoping somebody could shed some light on my problem. I currently
have a u_dw and a u_tvs with 2 levels. What I do is allow the user to
assign items from my datawindow to my treeview or remove them again
from the treeview.
The problem comes in when I give the user the option to remove ALL
level 2 items from the treeview. This is my code:
My problem is the following: For some reason the
returns the LAST item for that level. It then removes it but as there
is no items after that, returns -1 and exits the loop. ChildTreeItem!
Is suppose to get the first child of itemhandle.
Any advice will be greatly appreciated.
Kind regards,
Annelize
I was hoping somebody could shed some light on my problem. I currently
have a u_dw and a u_tvs with 2 levels. What I do is allow the user to
assign items from my datawindow to my treeview or remove them again
from the treeview.
The problem comes in when I give the user the option to remove ALL
level 2 items from the treeview. This is my code:
Code:
//remove all level 2 items from the treeview
ll_ItemHandle = tv.FindItem(RootTreeItem!, 0)
DO UNTIL ll_ItemHandle = -1
//get first child item handle
tv_default_nav.expanditem(ll_ItemHandle)
ll_childHandle = tv_default_nav.FindItem(ChildTreeItem!, ll_ItemHandle)
DO UNTIL ll_childHandle = -1
//Loop through all items in the child, delete(level 2)
tv_default_nav.DeleteItem(ll_childHandle)
ll_childHandle = tv_default_nav.FindItem(NextTreeItem!, &
ll_childHandle)
LOOP
ll_ItemHandle = tv_default_nav.FindItem(NextTreeItem! , ll_ItemHandle)
LOOP
My problem is the following: For some reason the
Code:
ll_childHandle = tv_default_nav.FindItem(ChildTreeItem!, ll_ItemHandle)
returns the LAST item for that level. It then removes it but as there
is no items after that, returns -1 and exits the loop. ChildTreeItem!
Is suppose to get the first child of itemhandle.
Any advice will be greatly appreciated.
Kind regards,
Annelize