i am selection row from gridview in which leftdate is not available/empty ,so when i select that row editing then exception is raised that (String was not recognized as a valid DateTime.')
here is screen shot

here c# code
- protected void Edit(object sender, EventArgs e)
- {
- using (GridViewRow row = (GridViewRow)((LinkButton)sender).Parent.Parent)
- {
- txtEmpID.ReadOnly = true;
- txtEmpID.Text = row.Cells[0].Text;
- txtEmpName.Text = row.Cells[1].Text;
- txtFahterName.Text = row.Cells[2].Text;
-
-
-
- txtCNIC.Text = row.Cells[3].Text;
- ddlSecID.ClearSelection();
- if (ddlSecID.Items.FindByText(row.Cells[4].Text) != null)
- {
- ddlSecID.Items.FindByText(row.Cells[4].Text).Selected = true;
- }
- if (ddlstatus.Items.FindByText(row.Cells[5].Text) != null)
- {
- ddlstatus.Items.FindByText(row.Cells[5].Text).Selected = true;
- }
- txtjdate.Text = Convert.ToDateTime(row.Cells[6].Text).ToString("dd/MM/yyyy");
-
-
-
- if (!string.IsNullOrEmpty(txtldate.Text))
- {
-
- txtldate.Text = null;
- }
- else
- {
- txtldate.Text = Convert.ToDateTime(row.Cells[7].Text).ToString("dd/MM/yyyy");
- }
-
- popup.Show();
- }
- }