|
发表于 2020-9-6 09:00:01
|
显示全部楼层
bool isNullRow;
for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
{
isNullRow = true;
foreach (DataGridViewCell cell in this.dataGridView1.Rows[i].Cells)
{
if (cell.EditedFormattedValue != null && string.IsNullOrEmpty(cell.EditedFormattedValue.ToString()) == false)
{
isNullRow = false;
break;
}
}
if (isNullRow)
{
//当前行所有列为空.
}
} |
|