I'm having some trouble moving items from one checkboxlist to another.
I basically have two checkbox lists, let's call them CB1 and CB2.
In CB2 I use a Dynamic Model to populate the checkboxlist.
This Dynamic Model does the following:
For each checked item in CB2, add that item to the array that is bound to CB1.
For each item in CB1, create a new entry for CB2 based on a text merge of CB1 plus the word "Dependant".
(in C# this would be somethingl Like var dependentName = CB1 + "Dependent";)
Do a check to see if the newly created entry is already in CB1 and if it is, remove it from CB2 and if not, add it to CB2.
I've tried numberous ways of removing the item from CB2 and each time I get different results.
Is there a simpler way of doing this kind of opperation? It seems like I'm going around the houses a bit on this one and my implimentations are becomming more and more grandiose.
I've tried creating a new array and populating that with only items not in CB1 and that also doesn't work.
My current method is that I create an empty array and I populate it with items not in CB1, then at the end of the process I remove all data from the origional list of CB2 items and copy the resupt of the new array to the old array.
When I do this, adding "item1" from CB1 seems to add "item1" and "item2".
Here's what my Dynamic Model looked like before I added the "Remove items from collection" component. This seems to work fine except I'm left with the item still in CB2 after it's been added to CB1.