Relationship between Comboboxes in C#
I have 2 comboboxes.
Each of them are bounded to same Table. When I change value in one of them the other combobex appropriate开发者_如何学Pythonly changed. How can I solve this problem?
Bind first ComboBox with data table then make a copy of data table in memory and bind it to the second ComboBox.
DataTable dataTable = db.FetchData();
ComboBox1.DataSource = dataTable;
// copying both structure and data
DataTable secondDataTable = dataTable.Copy();
ComboBox2.DataSource = secondDataTable;
精彩评论