Results 1 to 2 of 2

Thread: How do I transfer headings and items from one treeview to another

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    14

    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

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width