Habanero.Faces.Win.NumericUpDownCell.InitializeEditingControl C# (CSharp) Метод

InitializeEditingControl() публичный Метод

Initialises the editing control
public InitializeEditingControl ( int rowIndex, object initialFormattedValue, System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle ) : void
rowIndex int The row index number
initialFormattedValue object The initial value
dataGridViewCellStyle System.Windows.Forms.DataGridViewCellStyle The cell style
Результат void
        public override void InitializeEditingControl(int rowIndex, object
                                                                        initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)
        {
            // Set the value of the editing control to the current cell value.
            base.InitializeEditingControl(rowIndex, initialFormattedValue,
                                          dataGridViewCellStyle);
            NumericUpDownEditingControl ctl =
                DataGridView.EditingControl as NumericUpDownEditingControl;

            if (this.Value == null)
            {
                ctl.Value = 0;
            }
            else
            {
                if (this.Value.ToString() != "")
                    ctl.Value = Decimal.Parse(this.Value.ToString());
            }
        }