Пример #1
0
 public override void InitializeEditingControl(int rowIndex, object
                                               initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)
 {
     try
     {
         // Set the value of the editing control to the current cell value.
         base.InitializeEditingControl(rowIndex, initialFormattedValue,
                                       dataGridViewCellStyle);
         CalendarEditingControl ctl =
             DataGridView.EditingControl as CalendarEditingControl;
         ctl.Value = DateTime.Parse(this.Value.ToString());
     }
     catch (Exception ex)
     {
     }
 }
Пример #2
0
        public override void InitializeEditingControl(int rowIndex, object
                                                      initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)
        {
            try
            {
                // Set the value of the editing control to the current cell value.
                base.InitializeEditingControl(rowIndex, initialFormattedValue,
                                              dataGridViewCellStyle);
                CalendarEditingControl ctl =
                    DataGridView.EditingControl as CalendarEditingControl;
                ctl.Value = DateTime.Parse(this.Value.ToString());
            }
#pragma warning disable CS0168 // 声明了变量“ex”,但从未使用过
            catch (Exception ex)
#pragma warning restore CS0168 // 声明了变量“ex”,但从未使用过
            {
            }
        }