P
perrycheung221
Hi guys,
I got 2 listboxes in a window form, one on left and one on right. The
1st listbox have some items while the 2nd listbox is empty. Also there
are 2 buttons between the 2 listboxes which used to move item from/to
the 1st and 2nd listbox
My problem here is that after I bind the data to the 1st listbox (from
a dataTable, using DisplayMember and ValueMember), and I try to move 1
of the item from this 1st listbox to the 2nd listbox by:
If ListBox1.SelectedIndex <> -1 Then
ListBox2.Items.Add(ListBox1.SelectedItem)
ListBox1.Items.Remove(ListBox1.SelectedItem)
End If
Item can be add to the 2nd listbox but the displayText of it becoming:
System.Data.DataRowView
Anyone can help? Thanks!!
I got 2 listboxes in a window form, one on left and one on right. The
1st listbox have some items while the 2nd listbox is empty. Also there
are 2 buttons between the 2 listboxes which used to move item from/to
the 1st and 2nd listbox
My problem here is that after I bind the data to the 1st listbox (from
a dataTable, using DisplayMember and ValueMember), and I try to move 1
of the item from this 1st listbox to the 2nd listbox by:
If ListBox1.SelectedIndex <> -1 Then
ListBox2.Items.Add(ListBox1.SelectedItem)
ListBox1.Items.Remove(ListBox1.SelectedItem)
End If
Item can be add to the 2nd listbox but the displayText of it becoming:
System.Data.DataRowView
Anyone can help? Thanks!!