Пример #1
0
        public static void ys_AssetsStatus_GridLookUpEdit(DevExpress.XtraEditors.GridLookUpEdit Control)
        {
            #region 列名
            DevExpress.XtraGrid.Columns.GridColumn ID = new DevExpress.XtraGrid.Columns.GridColumn();
            ID.Name         = "Id";
            ID.Visible      = true;
            ID.FieldName    = "Id";
            ID.Caption      = "编号";
            ID.VisibleIndex = -1;

            DevExpress.XtraGrid.Columns.GridColumn Name = new DevExpress.XtraGrid.Columns.GridColumn();
            Name.Name         = "StatusName";
            Name.FieldName    = "StatusName";
            Name.Caption      = "名称";
            Name.VisibleIndex = 0;
            Name.Width        = 100;
            Name.Visible      = true;

            Control.Properties.PopupView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { ID, Name });

            #endregion
            Control.Properties.ImmediatePopup = true;
            Control.Properties.NullText       = "";
            Control.Properties.TextEditStyle  = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            Control.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True;
            Control.Properties.DisplayMember  = "StatusName";
            Control.Properties.ValueMember    = "Id";
            Control.Properties.View.OptionsView.ColumnAutoWidth = false;
            Control.Properties.DataSource = InitalControlHelper.GetAllAssetsStatus();
        }