How do I transfer headings and items from one treeview to another
I have a situation in which I want to move an item and its direct parents and children from one treeview to another.
Treeview1 initially looks like:
Metrics
.Metrics Item1
..Metrics Item1 Sub
.Metrics Item2
and TreeView2 is empty.
The user selects the item "Metrics Item1 Sub" and presses a button which functions to copy to TreeView2 that item and all its direct parents and children and remove from TreeView1 that item.
After the button is pressed, the treeviews look like:
TreeView1:
Metrics
.Metrics Item2
TreeView2:
Metrics
.Metrics Item1
..Metrics I1 text
How do I write the code for the function?
Thanks,
Mike
Re: How do I transfer headings and items from one treeview to another
All you have to do is remove the parent from one tree and add it to the other. All the other nodes will still have the same parent as they had before, so if that parent is in a different tree now then so are they.