Heya Gurus...
I miss the days when...
Remember in VB6 when one would have 2 Listboxes on a Form?
There would be arrow buttons >> or << between the 2 Listboxes and you populated the 1st Box with the content of a Lookup table, using a query, and the ID field of the table was the ItemData key which you would place ins1de the Listindex. Then, as you selected an item from the listbox on the left, you would click on the >> button to add it to the listbox on the right. In the end, once you added all the items you could then save the items on the right as values in another table with an Update/Insert query?
Now we are in VB.net and you no longer have ItemData. You have to bind the silly Listbox using the DisplayMember and ValueMember. And the Values I selected on the left now are placed in a Collection as they enter the Listbox on the right. So the Listbox on the right is bound to the Collection. But say you made a mistake and selected an item in error and now you need to remove it from the Listbox on the right? You would need to modify the underlying Collection object to remove the Selected Item in the Listbox, then re-set the Data Source of the Listbox to be the Collection again.
And this is where I get stuck. How do I do this?
Remember I still need to keep the ItemID's as I need to save them to another table on some other button's click event.
Does anyone have a magic wand for me?
B-)
Len
I miss the days when...
Remember in VB6 when one would have 2 Listboxes on a Form?
There would be arrow buttons >> or << between the 2 Listboxes and you populated the 1st Box with the content of a Lookup table, using a query, and the ID field of the table was the ItemData key which you would place ins1de the Listindex. Then, as you selected an item from the listbox on the left, you would click on the >> button to add it to the listbox on the right. In the end, once you added all the items you could then save the items on the right as values in another table with an Update/Insert query?
Now we are in VB.net and you no longer have ItemData. You have to bind the silly Listbox using the DisplayMember and ValueMember. And the Values I selected on the left now are placed in a Collection as they enter the Listbox on the right. So the Listbox on the right is bound to the Collection. But say you made a mistake and selected an item in error and now you need to remove it from the Listbox on the right? You would need to modify the underlying Collection object to remove the Selected Item in the Listbox, then re-set the Data Source of the Listbox to be the Collection again.
And this is where I get stuck. How do I do this?
Remember I still need to keep the ItemID's as I need to save them to another table on some other button's click event.
Does anyone have a magic wand for me?
B-)
Len