Exemplo n.º 1
0
        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);
            CalendarEditingControl iCalendarEditingControl = DataGridView.EditingControl as CalendarEditingControl;

            if (Value != null && Value != DBNull.Value)
            {
                iCalendarEditingControl.Value = (DateTime)Value;
            }
        }
Exemplo n.º 2
0
        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);
            CalendarEditingControl iCalendarEditingControl = DataGridView.EditingControl as CalendarEditingControl;

            iCalendarEditingControl.ShowUpDown   = true;
            iCalendarEditingControl.CustomFormat = "HH:mm";
            iCalendarEditingControl.Format       = DateTimePickerFormat.Custom;

            if (Value != null && Value != DBNull.Value)
            {
                iCalendarEditingControl.Value = Value;
            }
        }