Results 1 to 18 of 18

Thread: How do I remove rows in a datagridview using a Checkbox column?

Threaded View

  1. #1

    Thread Starter
    Lively Member Christhemist's Avatar
    Join Date
    Sep 2016
    Location
    Nevada
    Posts
    116

    How do I remove rows in a datagridview using a Checkbox column?

    I am looping backwards through my datagridview and removing any rows where the checkbox column is checked. However, it does not see all the checked checkboxes and therefor is not deleteing all the rows that are checked. I cannot for the life of me figure out why! Here is my code:

    Code:
    For i As Integer = DataGridView1.Rows.Count - 1 To 0 Step -1
    
                If DataGridView1.Rows(i).Cells(0).Value = True Then
                    DataGridView1.Rows.RemoveAt(i)
                Else
    
                End If
            Next i
    Last edited by Christhemist; Nov 9th, 2016 at 02:12 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width