I want to remove all the values that I have unchecked on data grid with a Cancel button.I know how to do it with the checked ones but how can I do it in the unchecked rows?
here is my code for the checkeded with the button Proceed
foreach (GridViewRow row in GridView1.Rows)
{
CheckBox chkRow = (row.Cells[0].FindControl("chkRow") as CheckBox);
if (chkRow.Checked)
{
con.Open();
cmd = new SqlCommand(@"UPDATE JobQuotations1
SET TransactionStatus = @Done
WHERE TransactionID = @Tid
AND
TransactionNum = @num", con);
cmd.Parameters.AddWithValue("@Done", "Done");
cmd.Parameters.AddWithValue("@Tid", row.Cells[2].Text);
cmd.Parameters.AddWithValue("@num", row.Cells[4].Text);
cmd.ExecuteNonQuery();
con.Close();
LoadDataGrid();
}
}