我在0
隐藏DataGridView
值的行时遇到问题。
foreach (DataGridViewRow row in this.taggGrid.Rows)
{
if (Convert.ToString(row.Cells[4].Value).Equals(0))
{
row.Visible = false;
}
}
我要隐藏的行仍会显示。
答案 0 :(得分:2)
(由OP编辑回答。见Question with no answers, but issue solved in the comments (or extended in chat))
OP写道:答案:自己解决了:
foreach (DataGridViewRow dr in taggGrid.Rows)
{
if (dr.Cells[4].Value.ToString() == "False")
{
dr.Visible = false;
}
}