E
Earl
I have a listbox that I bind to an arraylist like so:
'in the module
Public CustomerList As New ArrayList
Public Sub PopulateCustomers()
'..... using DataReader
End Sub
'in the form class
lstCustomers.DisplayMember = ToString()
lstCustomers.ValueMember = "CustomerID"
lstCustomers.DataSource = CustomerList
Now if I unbind the datasource, I can read a SelectedValue of 0, but if I do
not unbind the datasource, the SelectedValue property returns the TEXT value
of the DisplayMember instead of the Int32 value of CustomerID and I
obviously get an error. Anyone seen this?
'in the module
Public CustomerList As New ArrayList
Public Sub PopulateCustomers()
'..... using DataReader
End Sub
'in the form class
lstCustomers.DisplayMember = ToString()
lstCustomers.ValueMember = "CustomerID"
lstCustomers.DataSource = CustomerList
Now if I unbind the datasource, I can read a SelectedValue of 0, but if I do
not unbind the datasource, the SelectedValue property returns the TEXT value
of the DisplayMember instead of the Int32 value of CustomerID and I
obviously get an error. Anyone seen this?