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());
}
Ranjit PowarPosted Jan 16, 2016, 8:25 AM
this.dtpStart.Value=DateTime.ParseExact(dgvContList.SelectedRows[0].Cells[3].ToString(),"dd/MM/yyyy", CultureInfo.InvariantCulture);
If this help you select it as correct answer.
JomarMark TamargoPosted Jan 17, 2016, 12:57 AM