Clearing TreeView problem...

  • Thread starter Thread starter dwhittenburg
  • Start date Start date
D

dwhittenburg

Here is what I have...
I have a TabControl with 4 TabPages...
Let say each TabPage has a TreeView on it that gets data added to it somehow
(no need to explain this)
The 4th TabPage is basically a summary of the other 3...
All of this is on a Panel that gets shown/hidden...
On the click of a menu item I clear the TreeView.Nodes.Clear() of each
TreeView on each TabPage...

What I'm seeing is the TreeView data on Page 1, 2, 3 is not clearing,
however the TreeView summary on Page 4 does not have the summary....I would
expect each TreeView on Page 1, 2, 3 to be cleared, but they are not...

This is pretty wierd...still looking into it...
 
ok...I believe my problem exists when I'm removing from the treeviews
TreeView1, TreeView2, TreeView3 and inserting into the summary
TreeViewSum...

I notice that there is no way to clone a TreeNode...still searching, but
does anyone have a solution for this?

here is what I'm doing that causes the reference to be broken...The
Nodes.Add is causing the oNode reference to be pulled from the TVSel
TreeView, so no action can be taken on that node anymore...hrmf...

Dim oNodes As TreeNodeCollection = TVSel.Nodes

Dim oNode As TreeNode

For Each oNode In oNodes

oSpecNode.Nodes.Add(oNode)

Next
 
Back
Top