DEV LookUpEdit 下拉框
System.Windows.Forms.ComboBox-->DevExpress.XtraEditors.LookUpEdit
string defaultvalue = ""; DataTable dtep_tagtype = JsonConvert.DeserializeObject<DataTable>(value); //DataRow dr = dtep_tagtype.NewRow(); //dr["sht"] = "-1"; //dr["txt"] = "全部"; //dttestresults.Rows.InsertAt(dr, 0); luetagtype.Properties.DataSource = dtep_tagtype; luetagtype.Properties.DisplayMember = "txt"; luetagtype.Properties.ValueMember = "sht"; luetagtype.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("txt", "标签类型")); luetagtype.Properties.NullText = ""; luetagtype.ItemIndex = 0;
this.luetagtype.EditValue.ToString();//获取选中值的值
属性:
ComboBoxEdit:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
private void LoadComboBoxEdit() { this.comboBoxEdit1.Properties.NullText = "请选择..."; DataTable dt = UserInfo.GetAreaDataTable(); //获取DataTable for (int i = 0; i < dt.Rows.Count; i++) { comboBoxEdit1.Properties.Items.Add(dt.Rows[i]["txt"].ToString()); } } cmbCBRS.SelectedIndex = 0;//默认选择第一个
cboSelectCB.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
cbograde.SelectedItem.ToString()
this.cboselect.Properties.Items.AddRange(new object[] { "A", "B"});
https://www.cnblogs.com/xiaofengfeng/archive/2011/11/24/2261337.html