public static void QueryCheckCmbPOTypeList(eSolutionDataContext db, ref CheckedComboBoxEdit cmbName, Boolean argAll = false) { DataTable dt = DatabaseHelper.GetUserCodeData(db, "POTYPE", "COMMON", false); cmbName.Properties.Items.Clear(); cmbName.Properties.DataSource = null; if (dt.Rows.Count > 0) { cmbName.Properties.DataSource = dt; cmbName.Properties.ValueMember = "ValueMember"; cmbName.Properties.DisplayMember = "DisplayMember"; cmbName.Properties.Items.Add("Value", CheckState.Unchecked, true); cmbName.CheckAll(); cmbName.SetEditValue(0); cmbName.CheckAll(); } else { cmbName.SetEditValue(null); } cmbName.Properties.PopupControl = null; cmbName.Properties.SeparatorChar = ';'; cmbName.Properties.PopupResizeMode = DevExpress.XtraEditors.Controls.ResizeMode.LiveResize; }
/// <summary> /// 设置下拉列表选中指定的值 /// </summary> /// <param name="combo">下拉列表</param> /// <param name="value">指定的CListItem中的值</param> public static void SetComboBoxItem(this CheckedComboBoxEdit combo, string value) { combo.SetEditValue(value); }
//public static bool ClearLookUpedit = true; public static void ClearControls(Control panel) { foreach (Control item in panel.Controls) { var _Type = item.GetType(); switch (_Type.Name) { case "TextEdit": { item.Text = ""; break; } case "LookUpEdit": { LookUpEdit item1 = (LookUpEdit)item; if (Convert.ToInt32(item1.EditValue) > 0) { item1.EditValue = 0; } break; } case "ComboBoxEdit": { ComboBoxEdit item1 = (ComboBoxEdit)item; item1.SelectedIndex = -1; break; } case "CheckEdit": { CheckEdit item1 = (CheckEdit)item; // if (item1.Name != "chkIsActive") item1.Checked = false; break; } case "GroupBox": { GroupBox item1 = (GroupBox)item; item1.Controls[0].Text = ""; break; } case "PictureEdit": { PictureEdit item1 = (PictureEdit)item; item1.Image = null; break; } case "CheckedComboBoxEdit": { CheckedComboBoxEdit item1 = (CheckedComboBoxEdit)item; item1.SetEditValue(0); break; } case "MemoEdit": { item.Text = ""; break; } default: break; } } }