Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide row with specific cell value DataGridView C#

I'm having trouble hiding rows with 0 value in DataGridView.

foreach (DataGridViewRow row in this.taggGrid.Rows)
{
    if (Convert.ToString(row.Cells[4].Value).Equals(0))
    {
        row.Visible = false;
    }
}

The row I want to hide still shows.

like image 489
user2488982 Avatar asked Jun 15 '13 14:06

user2488982


1 Answers

(Answered by the OP in edits. See Question with no answers, but issue solved in the comments (or extended in chat) )

The OP wrote:

ANSWER: Solved it myself:

foreach (DataGridViewRow dr in taggGrid.Rows)
        {
            if (dr.Cells[4].Value.ToString() == "False")
            {
                dr.Visible = false;
            }
        }
like image 138
2 revs Avatar answered Oct 17 '22 06:10

2 revs