ComboBox Databinding
-
I have a typed dataset with an integer value called FiscalMonth. What I want to do is bind it to a combobox that is preseeded with a list of integers from 1-12. Here's what I have so far:
for (int i = 1; i <= 12; i++) { uxcbFMonth.Items.Add(i); } mySource = new BindingSource(); mySource.DataSource = myManagerClient.VersionTable.Select("VersionKey = " +VersionKey.ToString())[0];
That seems to work just fine, the combobox is populated, and in the text fields, the databinding (using Control.DataBindings.Add) works. The problem is it doesn't appear as if the combobox databinding works, because when I try to change it the control locks and remains selected until I manually close the application. I assign the databindings like this:uxcbFMonth.DataBindings.Add("SelectedValue", mySource, "FiscalMonth", true, DataSourceUpdateMode.OnValidation);
Am I binding to the wrong value? Any ideas?