ComboBoxEdit sets option values (multiple choice) and comboboxedit multiple choice
Add your own supplements to the online search examples
Lookupedit option value:
Private void LookUpEditFormTest_Load (object sender, EventArgs e) {IList <Hiscashs> list = HiscashsService. getTableCovList (); this. comboBoxEdit1.Properties. dataSource = list; this. comboBoxEdit1.Properties. displayMember = "EN_CURRENT_BALANCE"; this. comboBoxEdit1.Properties. valueMember = "I _ENTER_DATE"; comboBoxEdit1.Properties. columns. add (new LookUpColumnInfo ("I _ENTER_DATE", "date", 20); comboBoxEdit1. Properties. columns. add (new LookUpColumnInfo ("EN_CURRENT_BALANCE", "current amount", 80); // comboBoxEdit1.ItemIndex = 0; // select the first item comboBoxEdit1.ItemIndex =-1; // no options, in this case, the nulltext value is displayed. In fact, as long as editvalue = null, lookupedit will display nulltext} private void comboBoxEdit1_EditValueChanged (object sender, EventArgs e) {string name = this. comboBoxEdit1.SelectedText; string value = this. comboBoxEdit1.EditValue. toString (); // automatically searches Select a value that matches datasouse. If no value is available, the value is null. The value must be of the same data type as valuemember. MessageBox. Show (name + "=" + value);}/* asked hovertree.com */
CheckedComboBoxEdit:
Public void TestFunc () {for (int I = 0; I <IniFunc (). count; I ++) {if (IniFunc () [I]. isno = true) checkedComboBoxEdit1.Properties. items. add (I, IniFunc () [I]. name, CheckState. checked, true); else checkedComboBoxEdit1.Properties. items. add (I, IniFunc () [I]. name, CheckState. unchecked, true);} // cancel the selected status checkedComboBoxEdit1.Properties in the second column. items [1]. checkState = CheckState. unchecked; // checkedComboBoxEdit1 MessageBox. show (this. checkedComboBoxEdit1.SelectedText + "=" + this. checkedComboBoxEdit1.EditValue. toString ();} public BindingList <Data> IniFunc () {BindingList <Data> bindlist = new BindingList <Data> (); bindlist. add (new Data {ID = 1, Name = "Kobe", Isno = true}); bindlist. add (new Data {ID = 2, Name = "Iverson", Isno = false}); bindlist. add (new Data {ID = 3, Name = "Yao Ming", Isno = false}); bindlist. add (new Data {ID = 4, Name = "Wade", Isno = true}); bindlist. add (new Data {ID = 5, Name = "James", Isno = true}); return bindlist ;}} public class Data {public int ID {get; set ;} public string Name {get; set;} public bool Isno {get; set ;}/ * He asked hovertree.com */
Supplement: checkedComboBoxEdit multiple choice settings
Anti-binding focus:
DevExpress. xtraEditors. checkedComboBoxEdit cmb_check_CKID = new DevExpress. xtraEditors. checkedComboBoxEdit (); private void GetAllCK () {List <TB_STORE> list = (List <TB_STORE>) serviceLocator. getService <ITB_STOREBLL> (). getAllStore (StaticUser. conmanyID); // <span> list; cmb_check_CKID.Properties.DisplayMember = "STORENAME"; cmb_check_CKID.Properties.ValueMember = "ID"; identifier = ','; // <span>} this. cmb_check_CKID.RefreshEditValue (); // This sentence is very important when anti-binding./* why do you ask hovertree.com */
Http://www.cnblogs.com/roucheng/p/DGVHeaderText.html