I'm stuck with this code. I want to hide some rows so I wrote this line first and its work fine
foreach (DataGridViewRow row in dataGridView1.Rows)
{
if ((string)row.Cells[11].Value != (string)row.Cells[12].Value)
{
row.DefaultCellStyle.BackColor = Color.Red;
}
else
{
row.DefaultCellStyle.BackColor = Color.Green;
}
}
I want now to hide row instead of green color so I changed
row.DefaultCellStyle.BackColor = Color.Green;
with
row.Visible = false;
but i get an error with that.