Move item from listbox

goluguddu

New member
Joined
Sep 20, 2005
Messages
2
Programming Experience
1-3
Hi

I have two list boxes. One is filled with items. Each item in a list box is a object of class "Student" that has two members Name and Id.
List box is filled by set its datasource property. Where the display member is "Name" and valuemember is "Id".

Now I want to move these items to another list box such that a items moves as a object. Not just text.

When I select any item in Listbox1 and add it to listbox 2 like....
Listbox2.items.add(Listbox1.selecteditem)

How Do I set the display property and value property for listbox2.

Please help me.
Thanks.
 
When you have a databound control, you work with the datasource. Changes to the datasource are reflected in the listbox.
Therefore, one solution would be to create a similar datasource for the second listbox and move items from one datasource to the next.
 
Back
Top