Find ValueMember in ComboBox
Posted on 2003-11-18
I am trying to find the value that matches my variable and set the index, but I'm getting errors.
The combobox is bound to a sql table:
DestinationCombo.DisplayMember = DisplayName
DestinationCombo.ValueMember = ValueName
DestinationCombo.DataSource = SourceTable
Then I try to set the index:
For iCtr = 0 To DestinationCombo.Items.Count - 1
If DestinationCombo.Items(iCtr).value = "Hello" Then
DestinationCombo.Items(iCtr).Selected = True
And I get the following error:
Public member 'value' on type 'DataRowView' not found.
How do search for a Value property without getting the error. I don't have this problem searching the DisplayMember.