We can't solve this for you - we can't run that code in isolation and get teh same results you do with your data.
So start with the debugger.
Put a breakpoint on this line:
if (cell =="yes")
And run your app. when it hits the breakpoint, it will stop, and let you look at exactly what is going on.
Look at the content of "cell" - is it a string? Does it contain "yes" in that exact text, or is the string "Yes", or "YES"?
I suspect that because cell is an object, it's doing a reference comparison between the value returned from your cell and the string "yes" - in which case try this instead:
foreach (DataGridViewRow row in dataGridView1.Rows)
string cell = (string) row.Cells["dgvdel"].Value;
if (cell.ToLower() == "yes")
You are almost certainly getting a warning for this when you compile:
Possible unintended reference comparison
If so, then you should always treat warnings as errors to avoid this kind of problem.