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;
- //ddlSecID.ClearSelection();
- //ddlSecID.Items.FindByText(row.Cells[3].Text).Selected = true;
- //txtjdate.Text = row.Cells[4].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))
- {
- // DateTime date = DateTime.Parse(txtldate.Text);
- txtldate.Text = null;
- }
- else
- {
- txtldate.Text = Convert.ToDateTime(row.Cells[7].Text).ToString("dd/MM/yyyy");
- }
- popup.Show();
- }
- }


Priyanka JainRank #356 · 7K reputationPosted Sep 11, 2019, 3:28 AM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Sep 10, 2019, 11:48 PM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Sep 11, 2019, 2:17 AM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Sep 11, 2019, 2:44 AM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Sep 11, 2019, 3:16 AM EDT
Amit MohantyRank #112 · 20K reputationPosted Sep 11, 2019, 3:52 AM EDT
Akhter HUssainRank #1,522 · 1K reputationPosted Sep 11, 2019, 3:54 AM EDT
Priyanka JainRank #356 · 7K reputationPosted Sep 11, 2019, 4:04 AM EDT
Priyanka JainRank #356 · 7K reputationPosted Sep 11, 2019, 4:39 AM EDT
Priyanka JainRank #356 · 7K reputationPosted Sep 11, 2019, 5:26 AM EDT
Priyanka JainRank #356 · 7K reputationPosted Sep 11, 2019, 5:35 AM EDT
Bidyasagar MishraRank #766 · 3K reputationPosted Sep 10, 2019, 11:54 PM EDT
Akhter HUssainRank #1,522 · 1K reputationPosted Sep 11, 2019, 2:09 AM EDT
Akhter HUssainRank #1,522 · 1K reputationPosted Sep 11, 2019, 2:27 AM EDT
Akhter HUssainRank #1,522 · 1K reputationPosted Sep 11, 2019, 3:07 AM EDT
Akhter HUssainRank #1,522 · 1K reputationPosted Sep 11, 2019, 3:37 AM EDT
Akhter HUssainRank #1,522 · 1K reputationPosted Sep 11, 2019, 4:23 AM EDT
Priyanka JainRank #356 · 7K reputationPosted Sep 11, 2019, 4:27 AM EDT
Akhter HUssainRank #1,522 · 1K reputationPosted Sep 11, 2019, 4:35 AM EDT
Akhter HUssainRank #1,522 · 1K reputationPosted Sep 11, 2019, 4:45 AM EDT
Priyanka JainRank #356 · 7K reputationPosted Sep 11, 2019, 4:47 AM EDT
Akhter HUssainRank #1,522 · 1K reputationPosted Sep 11, 2019, 4:52 AM EDT
Akhter HUssainRank #1,522 · 1K reputationPosted Sep 11, 2019, 5:31 AM EDT
Akhter HUssainRank #1,522 · 1K reputationPosted Sep 11, 2019, 5:34 AM EDT
Akhter HUssainRank #1,522 · 1K reputationPosted Sep 11, 2019, 5:44 AM EDT
Jared Madurai8 reputationPosted Sep 15, 2019, 8:12 AM EDT