/// <summary> /// 绑定gridColumn校区 /// </summary> /// <param name="col">gridColumn列</param> public static void BindGridSchoolZone(this GridColumn col) { if (col == null || col.View.GridControl == null) { throw new ArgumentNullException("col"); } var lk = new CSmartRepositoryItemLookupEdit(); lk.TextEditStyle = TextEditStyles.Standard; var info = new LookUpColumnInfo("SchoolZoneCode", "编号"); lk.Columns.Add(info); info = new LookUpColumnInfo("SchoolZoneName", "校区"); lk.Columns.Add(info); var listIsValid = (List <SchoolZone>)ClientCache.GetAuto("SchoolZone", () => new SchoolZoneDao().GetList()); lk.DataSource = listIsValid; lk.DisplayMember = "SchoolZoneName"; lk.ValueMember = "SchoolZoneID"; lk.NullText = ""; lk.ShowHeader = true; lk.PopupWidth = 150; col.View.GridControl.RepositoryItems.Add(lk); col.ColumnEdit = lk; }
/// <summary> /// 绑定gridColumn职位 /// </summary> /// <param name="col">gridColumn列</param> /// <param name="bindType">类型</param> public static void BindGridDuty(this GridColumn col) { if (col == null) { throw new ArgumentNullException("GridColumn is null"); } if (col.View.GridControl == null) { throw new ArgumentNullException("GridColumn.View.GridControl is null!"); } CSmartRepositoryItemLookupEdit lk = new CSmartRepositoryItemLookupEdit(); lk.TextEditStyle = TextEditStyles.Standard; LookUpColumnInfo info = new LookUpColumnInfo("DutyCode", "编号"); lk.Columns.Add(info); info = new LookUpColumnInfo("DutyName", "名称"); lk.Columns.Add(info); info = new LookUpColumnInfo("MnemonicCode", "助记码"); lk.Columns.Add(info); List <Duty> ListIsValid = (List <Duty>)ClientCache.GetAuto("Duty", () => new DutyDao().GetList()); lk.DataSource = ListIsValid; lk.DisplayMember = "DutyName"; lk.ValueMember = "DutyID"; lk.NullText = ""; lk.ShowHeader = true; lk.PopupWidth = 200; col.View.GridControl.RepositoryItems.Add(lk); col.ColumnEdit = lk; }
/// <summary> /// 构造函数 /// </summary> static CSmartTreeListLookUpEditBase() { CSmartRepositoryItemLookupEdit.RegisterCustomEdit(); }