I am setting the datasource of a combobox to a arraylist that has two
members (value and display). When I want to get the value of the combobox,
there are no problems. However, when I try to set the selectedvalue to a
value that I know for a fact is in there, using this code:
cboAuthor.SelectedValue = intOldAuthor
nothing happens. If I do a for loop, setting the selectedindex and a if
statement, with the following code:
For x = 0 To cboAuthor.Items.Count - 1
cboAuthor.Items.Item(x) = x
If cboAuthor.SelectedValue = intOldAuthor Then
Exit For
End If
Next
I can get the desired value, but the end user will be able to see it going
thru the list. Any suggestions on how I can set the SelectedValue as if I
were just connected to a dataset???
|