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)
{
//All columns in the current row are empty.
}
}
[Quote=Quote the reply from17132929on the 2nd floor:]
I want to ask a question: how can I add the name of each row to the first column of the DataGridView, thank you!
[/Quote]
Loop the row information and add it to the column name!