Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Treeview Remove
Message
From
21/09/2000 17:09:11
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00419374
Message ID:
00419387
Views:
25
Roi,

Try THISFORM.oTree.Nodes.REMOVE(iNodeIndex)

Dan

>>Are you sure that node exist? When you remove some node, other nodes' indexes shifted. So last node index no longer valid.
>
>I would think so. It errors on the first time through the loop, before anything gets deleted.
>
>So if the indexes change how would I do it? Just keep using the FirstSibling index until Children returns .F.?
>
>>
>>>I'm trying to remove all the sibling nodes in a treeview and I keep getting the error "Unknown Name" on the Remove line.
>>>
>>>
oParentNode = toNode.PARENT
>>>iNodeIndex = oParentNode.FirstSibling.INDEX
>>>
>>>DO WHILE .T.
>>>	IF iNodeIndex <> oParentNode.LastSibling.INDEX
>>>		THISFORM.oTree.Nodes(iNodeIndex).REMOVE && Error occurs here
>>>		iNodeIndex  = THISFORM.oTree.Nodes(iNodeIndex ).NEXT.INDEX
>>>	ELSE
>>>		THISFORM.oTree.Nodes(iNodeIndex).REMOVE
>>>		EXIT
>>>	ENDIF
>>>ENDDO
>>>
>>>Can anybody see what I'm doing wrong? TIA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform