friends,
I am trying a new method of getting data (OSD's) and I am having trouble getting the valuemember added to the combobox that I am trying to populate.
Here is where I am tryting to populate it:
Public Sub ProcessCarList(ByVal RunID As Integer)
Try
frmMain.cmbPickACar.Items.
Clear()
Using TableAdapter As New dsPenalizedCarTableAdapter
s.CarNumbe
rListTable
Adapter
Using DataTable As dsPenalizedCar.CarNumbersD
ataTable = TableAdapter.GetData(RunID
)
Dim Row As dsPenalizedCar.CarNumbersR
ow
For Each Row In DataTable
frmMain.cmbPickACar.Items.
Add(Row.Ca
rNumber)
frmMain.cmbPickACar.ValueM
ember = (Row.ResultID)
Next
End Using
End Using
Catch ex As Exception
End Try
End Sub
Now, when I click the combobox, I see all the car numbers listed; however, if I try to use the value portion of the combobox, there is nothing in it.
Private Sub cmbPickACar_DropDown(ByVal
sender As System.Object, ByVal e As System.EventArgs) Handles cmbPickACar.DropDown
Dim HandleCars As New HandleCarList
HandleCars.ProcessCarList(
RunID)
End Sub
Private Sub cmbPickACar_SelectedIndexC
hanged(ByV
al sender As System.Object, ByVal e As System.EventArgs) Handles cmbPickACar.SelectedIndexC
hanged
Dim ResultItemIDToUse As String = ""
If cmbPickACar.SelectedIndex <> -1 Then
ResultItemIDToUse = cmbPickACar.SelectedValue
MessageBox.Show(ResultItem
IDToUse)
End If
End Sub
What am I doing wrong?
Thanks in advance!
Best Regards,
Eric
Start Free Trial