Z
Z
zbender2014-11-20 22:53:34
.NET
zbender, 2014-11-20 22:53:34

How to use one List for two comboboxes?

There is combobox1 and combobox2. There is a list.
list = List<objects>
combobox1 and combobox2 contain the same values ​​(list):

combobox1.DataSource = list;
combobox2.DataSource = list;

When I change the value in combobox1, it also changes in combobox2 (and vice versa).
How to make selected combobox values ​​independent?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lam0x86, 2014-11-20
@zbender

comboBox1.DataSource = new BindingSource() {DataSource = list};
comboBox2.DataSource = new BindingSource() {DataSource = list};

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question