I am building an application which connects to a database through the Microsoft entity model framework built in Visual Studio 2010.
This is my problem:
I have two ComboBox
which are using the table Places
. Every time I change the selected item of one of these ComboBoxes, the other box changes it too. This means I have always the same value on both combo boxes.
I think this has to do with the entity they are sharing. How can I split it up? I'd prefer not to make two database tables, and to keep it stupid simple.
Here is how I bind the two comboboxes to the entity.
this.comboBoxDeparturePlace.DataSource = this.m_DatabaseEntity.Places;
this.comboBoxDestinationPlace.DataSource = this.m_DatabaseEntity.Places;
Thanks for your help!
EDIT:
My Model looks like this:
The SelectedItem is a place with those properties (ID, DisplayName, PostalCode, Name)
The DisplayName is the value being displayed on the ComboBox.
The ID is the SelectedValue.