1
我有一个数据网格称为dataGridView1
数据网格行,它有一个单元格中包含日期,我想基于色彩的在下面的代码中的某些行:删除基于单元格值
foreach (DataGridViewRow row in dataGridView1.Rows)
{
if ((Convert.ToDateTime(row.Cells[7].Value) - DateTime.Today).Days <= 90)
{
row.DefaultCellStyle.BackColor = Color.Green;
}
}
此代码成功上。我想要的是删除所有未着色的剩余行,该怎么做?