I have a problem binding a combobox in a windows form, what i'm trying to do is the following:
I need to bind the combobox to a column (ex: customerID) in a dataset. this column is a foreign key.
howerver, I want the datasource of the combobox to be the list of customer names in another table that consists of customer names and ids.
i'm setting the bindings property of the combobox to the proper column in the dataset, and from the code i'm doing the following:
comboBox1.DisplayMember = ds.Tables["tableName"].Columns["customerName"].ColumnName.ToString(); comboBox1.ValueMember = ds.Tables["tableName"].Columns["customerId"].ColumnName.ToString(); comboBox1.DataSource = ds.Tables["tableName"];
I'm using a binding navigator, running the previous code at form load, I can navigate through the records correctly, the combobox displays customernames corresponding to ids. however when I try to insert a new record I choose customer name from the list but then the cursor is trapped in the combobox and i can't move to any other field unless I type an id in the combobox!!
Can anybody help me with this please?