To reproduce:
1. Run code. Select upper
2. press Tab
Observed:
combobox contains lower
Expected:
should contain upper
How to fix ?
using System.Windows.Forms;
using System.Data;
class testForm : Form {
ComboBox comboBox1;
testForm() {
DataTable t = new DataTable();
t.Columns.Add("displaymember");
t.Columns.Add("valuemember");
t.Rows.Add("lower", "a");
t.Rows.Add("upper", "A");
comboBox1 = new ComboBox();
comboBox1.DisplayMember = "displaymember";
comboBox1.ValueMember = "valuemember";
comboBox1.DataSource = t;
comboBox1.DataBindings.Add("SelectedValue", new bo(), "controlsrc");
TextBox tb = new TextBox();
tb.Top = 100;
Controls.AddRange(new Control[] { comboBox1, tb });
}
class bo {
string t;
public string controlsrc {
get { return t; }
set { t = value; }
}
}
static void Main() {
Application.Run(new testForm());
}
}
Andrus