JomarMark Tamargo

JomarMark Tamargo

  • NA
  • 27
  • 3.3k

datagridview value to date time picker

Jan 16 2016 7:16 AM
i am trying to put the date from gridview into datetimepick.
 
this the error i got.
 
{"The string was not recognized as a valid DateTime. There is an unknown word starting at index 0."}
 
this the code is if you click the row it transfer the data in information field
 
private void dgvContList_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
this.dtpStart.Value = Convert.ToDateTime(dgvContList.SelectedRows[0].Cells[3].ToString());
this.dtpEnd.Value = Convert.ToDateTime(dgvContList.SelectedRows[0].Cells[4].ToString());
}

Answers (2)