CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Feb 2010
    Posts
    3

    Help moving/copying nodes between 2 treeViews

    In my C# 2008 application, I have two treeview controls and Add, AddAll, Remove, and RemoveAll buttons. When the application starts, a populate() method is called which reads in the files in a specified directory and populate treeView1 which looks like this:

    Billing
    |---cBilling1
    |---cBilling2
    Home
    |---cHome
    Login
    |---cLogin1
    |---cLogin2

    The user can copy/move a parent and all children or just a child between treeViews. The code is intelligent enough (almost) to know how to copy/move parents and children around so that the structure of both treeViews remains intact.

    The issue I have is after I copy a child from treeView1 to treeView2 and then try to move that child back to treeView1, the child is put with the wrong parent. Below is the scenario.

    Scenario #1:
    1. Click on cBilling1 in treeView1.
    2. Click the Add button
    3. Click on cBilling1 in treeview2.
    4. Click Remove.
    -- cBilling1 is placed under the wrong parent.

    The populate() method expects a folder the following folder structure and files in them (which can be empty).

    C:\QA\Testscripts\Billing\cBilling1.py
    C:\QA\Testscripts\Billing\cBilling2.py
    C:\QA\Testscripts\Home\cHome.py
    C:\QA\Testscripts\Login\cLogin.1py
    C:\QA\Testscripts\Login\cLogin2.py

    I appreciate any and all help!
    Attached Files Attached Files

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

Featured