title: DateTime in c# throwing exception Specified cast is not valid
body: <pre><code>private void dataGridView1_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
      {
          try
          {
              if ((dataGridView1.Focused) &amp;&amp; (dataGridView1.CurrentCell.ColumnIndex == 0))
              {
                  dtpInstallment.Location = dataGridView1.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false).Location;
                  dtpInstallment.Visible = true;
                  if (dataGridView1.CurrentCell.Value != DBNull.Value)
                  {
                     // dtpInstallment.Value = DateTime.Today;
                     dtpInstallment.Value = (DateTime)dataGridView1.CurrentCell.Value;
  
                 //     DateTime date = (DateTime)dataGridView1.CurrentCell.Value;
                   //   dtpInstallment.Value = DateTime.Parse(date.ToString("dd/MM/yyyy"));
  
  
                  }
                  else
                  {
                      dtpInstallment.Value = DateTime.Today;
                  }
              }
              else
              {
                  dtpInstallment.Visible = false;
              }
          }
          catch (Exception ex)
          {
              MessageBox.Show(ex.Message);
          }
      }
  </code></pre>
  
  <blockquote>
    <p>In this datetime is throwing an exception...there is value in dataGridView1.CurrentCell.Value..but not able to convert to dtpInstallment.value which is DateTimePicker</p>
  </blockquote>