Printer friendly version Remove Selected Nodes from TreeView
by Jona Kee

I am able to remove MyTreeViewItem's from the TreeViewItemsCollection but when the control renders again the items remain. What am I missing? Does the collection ever get re-bound to the control before render?
Private Sub RemoveItems(ByRef Items As FunkeLab.MyTreeViewItemCollection)

Dim i As FunkeLab.MyTreeViewItem

For Each i In Items
If i.Selected Then
MyTreeView1.Items.Remove(i)
ElseIf i.Items.Count > 0 Then
RemoveItems(i.Items)

End If
Next
End Sub

Write reply   Tip a friend  Go back