Results 1 to 2 of 2

Thread: Removing specific Rows in DataGridView

  1. #1

    Thread Starter
    Hyperactive Member yousufkhan's Avatar
    Join Date
    Jan 2002
    Location
    India
    Posts
    492

    Removing specific Rows in DataGridView

    i have datagridview for displaying and records and to remove the rows the dgv is having a checkbox for selecting the rows to remove

    i did in the following way
    Code:
    For Each row As DataGridViewRow In dgAllBags.Rows
                If row.Cells("Checkbox").Value = True Then
                    dgAllBags.Rows.Remove(row)
                End If
            Next
    but when i am selecting all rows suppose their are 8 rows so it removes only 4

  2. #2
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,684

    Re: Removing specific Rows in DataGridView

    Hello,

    The attached VS2012 project shows how to removed checked rows for an unbound DataGridView
    Name:  AM.png
Views: 84
Size:  24.3 KB
    Attached Files Attached Files

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