我的C#Foreach循环中的continue语句有问题。C#Foreach循环 - 继续问题
我希望它检查datagridview中是否有空白单元格,如果是,则跳过打印值并继续检查下一个单元格。
帮助大大赞赏。
下面是代码:
foreach (DataGridViewRow row in this.dataGridView1.Rows)
{
foreach (DataGridViewCell cell in row.Cells)
{
if (cell.Size.IsEmpty)
{
continue;
}
MessageBox.Show(cell.Value.ToString());
}
}
你已经忘了提及您所看到的问题... – 2009-05-02 16:32:22