【发布时间】:2012-06-15 09:02:11
【问题描述】:
我想检查我在 datagridview 中的“多”列是否为空。
这是我的代码
for (int i = 0; i < (gridx.Rows.Count - 1); i++)
{
col = gridx.Rows[i].Cells["code"].Value.ToString();
col4 = gridx.Rows[i].Cells["many"].Value.ToString();
}
if (col4 == "")
{
MessageBox.Show("Many is empty");
this.Focus();
return;
}
else
{
//my code in here
}
但它不显示错误“很多是空的”
请帮帮我.. 之前谢谢
【问题讨论】:
-
单步调试时'col4'的值是多少?
-
您想知道一个单元格是空的还是所有单元格?有没有异常,你用过调试器吗?
标签: c# datagridview