When I try to bind two ComboBoxes to the same DataTable, both ComboBoxes show the same values, changing one changes the other. How do I make them have distinct values?
Use different BindngContext objects for the two ComboBoxes as shown here.
comboBox1.BindingContext = new BindingContext();
comboBox1.DataSource = dataset.Tables[ "Orders" ];
comboBox1.ValueMember = "CustomerID";
comboBox1.DisplayMember = "CustomerID";
comboBox2.BindingContext = new BindingContext();
comboBox2.DataSource = dataset.Tables[ "Orders" ];
comboBox2.ValueMember = "CustomerID";
comboBox2.DisplayMember = "CustomerID";
Contributed from George Shepherd's Windows Forms FAQ