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).
it seems to work fine. only the Login node is being splitted when I move everything to the right and then back to the left.
win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming
remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation
private lessons are not an option so please don't ask for help in private, I won't replay
if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know
I tried several scenarios and I still find there are a few issues such as:
Scenario #1:
1. Click Add All
2. Select cWater then click Remove
3. Select cLogin then click Remove -- cLogin is now a child of Water instead of Login.
Scenario #2:
1. Click on either cHome/cLogin/cWater then Add
2. Click on either cBilling1/cBilling2 then Add -- cBilling1/cBilling2 is add under the wrong parent
Out of curiosity, does your treeView look like mine? I don't know if it matters but I'm trying to make sure everything looks the same. I can send you a screen shot of what the above scenarios look like if you want.
after starting the app the tree on the left looks like this:
Billing
|---cBilling1
|---cBilling2
Home
|---cHome
Login
|---cLogin1
Login
|---cLogin2
win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming
remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation
private lessons are not an option so please don't ask for help in private, I won't replay
if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know
Thx for catching that issue; I also tidied up a few other things such as commenting out the two treeview sort methods in the DeleteNode method. I'm still getting some issues when I try to add and remove children around. I've attached the updated version of the program.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.