c# databinding combobox change fields
I have databound a DataTable to a combobox, and I have a textbox that is also linked to a field in this same table. The Date field updates as expected when switched between records, but changing the value of the Date field causes the list entry in the combobox to change to System.Data.DataRowView. The record still selects fine.
Here is the sample code;
comboBox1.Da开发者_JAVA百科taSource = TblA;
comboBox1.DisplayMember = "ID";
BindingContext binding = this.BindingContext;
BindingManagerBase IDSelected = binding[comboBox1.DataSource];
textBox1.DataBindings.Add("Text",TblA,"Date");
Try using Datasource Update Mode to Never
Binding Constructor (String, Object, String, Boolean, DataSourceUpdateMode)
精彩评论