Exemplo n.º 1
0
        public override object Clone()
        {
            CtlVSComboColumn that = (CtlVSComboColumn)base.Clone();

            that.Order                    = this.Order;
            that.PK                       = this.PK;
            that.Search                   = this.Search;
            that.DefaultValue             = this.DefaultValue;
            that.DBFieldType              = this.DBFieldType;
            that.Location                 = this.Location;
            that.AutoCompleteMode         = this.AutoCompleteMode;
            that.AutoCompleteSource       = this.AutoCompleteSource;
            that.AutoCompleteCustomSource = this.AutoCompleteCustomSource;
            that.AutoCompleteQuery        = this.AutoCompleteQuery;
            that.DBField                  = this.DBField;
            that.Attr                     = this.Attr;
            that.Add                      = this.Add;
            that.Upp                      = this.Upp;
            that.Del                      = this.Del;
            that.IsFlag                   = this.IsFlag;
            that.Locked                   = this.Locked;
            that.SPAddParamName           = this.SPAddParamName;
            that.SPUppParamName           = this.SPUppParamName;
            that.SPDelParamName           = this.SPDelParamName;
            that.Query                    = this.Query;
            that.Alignment                = this.Alignment;
            that.Sortable                 = this.Sortable;
            that.RowColor                 = this.RowColor;
            that.LinkedControl            = this.LinkedControl;
            that.Width                    = this.Width;
            return(that);
        }
Exemplo n.º 2
0
 public void AddColumn(string pName, string pDBFieldName = "", string pSPAdd = "", string pSPUpp = "", string pSPDel = "", bool pSortable = false,
                       bool pIsFlag = false, bool pLocked = false, string pQuery = "", int pWidth = 0, string pAlignment = "", string pAttr = "", AutoCompleteMode aMode = AutoCompleteMode.None, AutoCompleteSource aSource = AutoCompleteSource.None, string aQuery = "", bool pPrint = false, bool pVisible = true)
 {
     if (pQuery == "")
     {
         var _Col = new CtlVSTextBoxColumn()
         {
             Name       = pName,
             HeaderText = pName,
             //Colnumber = pColnumber,
             DBField          = pDBFieldName == "" ? pName : pDBFieldName,
             DataPropertyName = pName,
             Parent           = this,
             Attr             = pAttr,
             Add                = pSPAdd != "",
             Upp                = pSPUpp != "",
             Del                = pSPDel != "",
             SPAddParamName     = pSPAdd,
             SPDelParamName     = pSPDel,
             SPUppParamName     = pSPUpp,
             IsFlag             = pIsFlag,
             Locked             = pLocked,
             ReadOnly           = pLocked,
             Width              = pWidth,
             Alignment          = pAlignment,
             Sortable           = pSortable,
             LinkedControl      = null,
             AutoSizeMode       = pWidth == 0 ? DataGridViewAutoSizeColumnMode.DisplayedCells : DataGridViewAutoSizeColumnMode.None,
             AutoCompleteMode   = aMode,
             AutoCompleteSource = aSource,
             AutoCompleteQuery  = aQuery,
             Print              = pPrint,
             Visible            = pVisible
         };
         _Col.SetQuery(pQuery);
         Columns.Add(_Col);
     }
     else
     {
         var _Col = new CtlVSComboColumn()
         {
             Name       = pName,
             HeaderText = pName,
             //Colnumber = pColnumber,
             DBField          = pDBFieldName == "" ? pName : pDBFieldName,
             DataPropertyName = pName,
             Parent           = this,
             CellTemplate     = new DataGridViewComboBoxCell(),
             Attr             = pAttr,
             Add                = pSPAdd != "",
             Upp                = pSPUpp != "",
             Del                = pSPDel != "",
             SPAddParamName     = pSPAdd,
             SPDelParamName     = pSPDel,
             SPUppParamName     = pSPUpp,
             IsFlag             = pIsFlag,
             Locked             = pLocked,
             ReadOnly           = pLocked,
             Width              = pWidth,
             Alignment          = pAlignment,
             Sortable           = pSortable,
             LinkedControl      = null,
             AutoSizeMode       = pWidth == 0 ? DataGridViewAutoSizeColumnMode.DisplayedCells : DataGridViewAutoSizeColumnMode.None,
             DisplayStyle       = DataGridViewComboBoxDisplayStyle.DropDownButton,
             AutoComplete       = true,
             AutoCompleteMode   = aMode,
             AutoCompleteSource = aSource,
             AutoCompleteQuery  = aQuery,
             Print              = pPrint,
             Visible            = pVisible
         };
         _Col.SetQuery(pQuery);
         Columns.Add(_Col);
     }
 }