问题
I have 2 combo boxes that are tied up to a single binding source in a dataset. When I select an item in one of the combo boxes, they both change. I don't have code in the combobox themselves but I do have the dataset fill:
this.cLIENT_BranchesTableAdapter.Fill(this.gcDataSet.CLIENT_Branches);
What could be causing this?
回答1:
Give each ComboBox their own BindingSource:
comboBox1.DataSource = new BindingSource(source, string.Empty);
comboBox2.DataSource = new BindingSource(source, string.Empty);
回答2:
This should fix your issue.
combobox2.BindingContext = new BindingContext();
来源:https://stackoverflow.com/questions/33108993/multiple-combobox-with-single-datasource