Question DropDownList not selecting item when asked too

paris_tj

Member
Joined
Mar 2, 2010
Messages
7
Programming Experience
Beginner
ok I have a multiple for project and I am trying to set what the combobox selection is from another form, but it is not working.

This works fine here....
VB.NET:
    Public Sub PopulateCustomerNamelist(Optional idCustomerSelected As Integer = 0)
        gFrmServiceOrder.cboCustomer.DataSource = Nothing
        gFrmServiceOrder.cboCustomer.DataSource = DL.GetCustomerNameList
        gFrmServiceOrder.cboCustomer.DisplayMember = "idCustomer"
        gFrmServiceOrder.cboCustomer.ValueMember = "idCustomer"
        If idCustomerSelected <> 0 Then gFrmServiceOrder.cboCustomer.SelectedValue = idCustomerSelected
    End Sub

This does not work...
VB.NET:
    Public Sub PopulateCustomerNamelist(Optional idCustomerSelected As Integer = 0)
        gFrmServiceOrder.cboCustomer.DataSource = Nothing
        gFrmServiceOrder.cboCustomer.DataSource = DL.GetCustomerNameList()
        gFrmServiceOrder.cboCustomer.DisplayMember = "FullName"
        gFrmServiceOrder.cboCustomer.ValueMember = "idCustomer"
        If idCustomerSelected <> 0 Then gFrmServiceOrder.cboCustomer.SelectedValue = idCustomerSelected
    End Sub

The only difference in the code is this "gFrmServiceOrder.cboCustomer.DisplayMember = "idCustomer" to this: gFrmServiceOrder.cboCustomer.DisplayMember = "FullName"


Can someone give me some assistance please.
 
Back
Top