开发者

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜