ComboBoxEdit sets option values (multiple choice) and comboboxedit multiple choice

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.