<p>Assume you are doing something like the following</p>

<pre><code>List&lt;string&gt; myitems = new List&lt;string&gt;
{
    "Item 1",
    "Item 2",
    "Item 3"
};

ComboBox box = new ComboBox();
box.DataSource = myitems;

ComboBox box2 = new ComboBox();
box2.DataSource = myitems
</code></pre>

<p>So now we have 2 combo boxes bound to that array, and everything works fine. But when you change the value of one combo box, it changes BOTH combo boxes to the one you just selected.</p>

<p>Now, I know that Arrays are always passed by reference (learned that when i learned C :D), but why on earth would the combo boxes change together? I don't believe the combo box control is modifying the collection at all. </p>

<p>As a workaround, don't this would achieve the functionality that is expected/desired</p>

<pre><code>ComboBox box = new ComboBox();
box.DataSource = myitems.ToArray();
</code></pre>

[{'answer_id': 509, 'author': 'Robert Höglund', 'author_id': 143, 'author_profile': 'https://Stackoverflow.com/users/143', 'pm_score': 6, 'selected': True, 'text': '<p>This has to do with how data bindings are set up in the dotnet framework, especially the <code>BindingContext</code>. On a high level it means that if you haven\'t specified otherwise each form and all the controls of the form share the same <code>BindingContext</code>. When you are setting the <code>DataSource</code> property the <code>ComboBox</code> will use the <code>BindingContext</code> to get a <code>ConcurrenyMangager</code> that wraps the list. The <code>ConcurrenyManager</code> keeps track of such things as the current selected position in the list. </p>\n\n<p>When you set the <code>DataSource</code> of the second <code>ComboBox</code> it will use the same <code>BindingContext</code> (the forms) which will yield a reference to the same <code>ConcurrencyManager</code> as above used to set up the data bindings.</p>\n\n<p>To get a more detailed explanation see <a href="https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.bindingcontext" rel="nofollow noreferrer">BindingContext</a>.</p>\n'}, {'answer_id': 20142, 'author': 'Quibblesome', 'author_id': 1143, 'author_profile': 'https://Stackoverflow.com/users/1143', 'pm_score': 5, 'selected': False, 'text': '<p>A better workaround (depending on the size of the datasource) is to declare two <code>BindingSource</code> objects (new as of 2.00) bind the collection to those and then bind those to the comboboxes.</p>\n\n<p>I enclose a complete example.</p>\n\n<pre><code>using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Data;\nusing System.Drawing;\nusing System.Text;\nusing System.Windows.Forms;\n\nnamespace WindowsFormsApplication2\n{\n    public partial class Form1 : Form\n    {\n        private BindingSource source1 = new BindingSource();\n        private BindingSource source2 = new BindingSource();\n\n        public Form1()\n        {\n            InitializeComponent();\n            Load += new EventHandler(Form1Load);\n        }\n\n        void Form1Load(object sender, EventArgs e)\n        {\n            List&lt;string&gt; myitems = new List&lt;string&gt;\n            {\n                "Item 1",\n                "Item 2",\n                "Item 3"\n            };\n\n            ComboBox box = new ComboBox();\n            box.Bounds = new Rectangle(10, 10, 100, 50);\n            source1.DataSource = myitems;\n            box.DataSource = source1;\n\n            ComboBox box2 = new ComboBox();\n            box2.Bounds = new Rectangle(10, 80, 100, 50);\n            source2.DataSource = myitems;\n            box2.DataSource = source2;\n\n            Controls.Add(box);\n            Controls.Add(box2);\n        }\n    }\n}\n</code></pre>\n\n<p>If you want to confuse yourself even more then try always declaring bindings in the constructor. That can result in some <em>really</em> curious bugs, hence I always bind in the Load event.</p>\n'}]
['https://Stackoverflow.com/questions/482', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/77/']