Hi everyone,
I have a button and when clicked, open a panel with 2 combobox on a form. Depending on the selection of the first combobox (which is filled via a bindingsource) , ill be able to select the value I need on the second combobox. and here is my code for that :
however, as soon as I click on the button, this is the error im getting :
I look everywhere for that type of error but still not able to understand what im doing wrong in my code. Any help please would be appreciated.
Thank you :encouragement:
I have a button and when clicked, open a panel with 2 combobox on a form. Depending on the selection of the first combobox (which is filled via a bindingsource) , ill be able to select the value I need on the second combobox. and here is my code for that :
VB.NET:
Private Sub btnSearchFacture_Main_Click(sender As Object, e As EventArgs) Handles btnSearchFacture_Main.Click
PanelAddFacture.Visible = True
'Fill Name Combobox
With NameComboBox
.DataSource = TblCustomersBindingSource
.DisplayMember = "FirstName"
.ValueMember = "FirstName"
.AutoCompleteMode = AutoCompleteMode.SuggestAppend
.AutoCompleteSource = AutoCompleteSource.ListItems
End With
With MarqueComboBox
.DataSource = TblCarsBindingSource.Filter = "Customer_ID = " + TblCustomersBindingSource.Current("ID").ToString
.DisplayMember = "Marque"
.ValueMember = "Marque"
.AutoCompleteMode = AutoCompleteMode.SuggestAppend
.AutoCompleteSource = AutoCompleteSource.ListItems
End With
End Sub
however, as soon as I click on the button, this is the error im getting :
[An unhandled exception of type 'System.ArgumentException' occurred in System.Windows.Forms.dll
Additional information: Complex DataBinding accepts as a data source either an IList or an IListSource.
I look everywhere for that type of error but still not able to understand what im doing wrong in my code. Any help please would be appreciated.
Thank you :encouragement: