Click here to Skip to main content
15,902,926 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in right hand side their is listbox1 and i am selecting the multiple listbox items(items bind from the database). on button click i am moving listbox1 items to listbox2. that part i have done. but i am not getting the ids of listbox2 items.


so how to get the ids of listbox2 items.

What I have tried:

moving items form one listbox1 to listbox2 done successfully now problem is how to get the ids of listbox2 i want to store the items ids
Posted
Updated 13-Feb-19 22:26pm

1 solution

Normally, if I were doing something like this, I would maintain two ObservableCollections, one bound to the first ListBox and the second bound to the second ListBox. Then, when I wanted to move items between the ListBoxes, I would remove the item from the first ObservableCollection and add it into the second ObservableCollection. The appearance of moving is handled automatically through the magic of binding and I would then do processing against the actual elements in the ObservableCollection, rather than trying to hack back into the ListBox.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900