vb.net - Show only checked boxes in DataGridView -


I am returning the SQL result to a DataGridView and run into a problem. I have an option on my form that only shows checked values ​​but it can not work. Here is my code:

  x for integer = dgvAutogrow.Rows.Count as - 1 dgvAutogrow.Rows.Count to dgvAutogrow.Rows (x) .Cells ("Check ") Value = false. Then dgvAutogrow.Rows.Remove (dgvAutogrow.Rows (x)) end then the next  

here is what part of my DataGridView looks like. I want an incident that shows only the values ​​on which the check box is checked.

.netError

When I get the following error I get the debug: < / P>

. NetError

Any suggestions for changing?

You test the value to DataGridViewCheckBoxCell and the value like this:

  For integer = dgvAutogrow.Rows.Count - 1 for phase 0 -DataGridViewCheckBoxCell cell = dim cell as dual (dgvAutogrow.Rows (X) .Cells ("YourColumnName "), DataGridViewCheckBoxCell if cel.Value = false then dgvAutogrow.Rows.Remove (dgvAutogrow.Rows (x)) end then the next  

In addition, you have a argument exclusions , because the column you specified does not exist, you change it Will.


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -