Esempio n. 1
0
 public void FireFormatDropDownEvent(DataGridViewChooserControl ctl)
 {
     if (FormatDropDownEvent != null)
     {
         FormatDropDownEvent(this, new ChooserControlArgs(ctl));
     }
 }
        public override void PositionEditingControl(bool setLocation, bool setSize, System.Drawing.Rectangle cellBounds, System.Drawing.Rectangle cellClip, DataGridViewCellStyle cellStyle, bool singleVerticalBorderAdded, bool singleHorizontalBorderAdded, bool isFirstDisplayedColumn, bool isFirstDisplayedRow)
        {
            base.PositionEditingControl(setLocation, setSize, cellBounds, cellClip, cellStyle, singleVerticalBorderAdded, singleHorizontalBorderAdded, isFirstDisplayedColumn, isFirstDisplayedRow);
            DataGridViewChooserControl ctl = DataGridView.EditingControl as DataGridViewChooserControl;
            //if (ctl.Height < cellBounds.Height)
            //    ctl.Top += cellBounds.Height - ctl.Height;
            int h1 = cellBounds.Height;
            int h2 = 18;

            if (h1 > h2)
            {
                ctl.Top = (int)((h1 - h2) / 2);
            }
        }
        public override void InitializeEditingControl(int rowIndex, object initialFormattedValue, DataGridViewCellStyle cellStyle)
        {
            // Set the value of the editing control to the current cell value.
            base.InitializeEditingControl(rowIndex, initialFormattedValue, cellStyle);

            DataGridViewChooserControl ctl = DataGridView.EditingControl as DataGridViewChooserControl;

            DataGridViewDatColumn clmn = this.OwningColumn as DataGridViewDatColumn;

            ctl.Format   = cellStyle.Format;
            ctl.SetClass = clmn.SetClass;
            ctl.Value    = (BaseDat)this.Value;
            clmn.FireFormatDropDownEvent(ctl);
        }
Esempio n. 4
0
 public ChooserControlArgs(DataGridViewChooserControl chooser)
 {
     msg = chooser;
 }