Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27153

Cant Delete a Row from DataGridView

$
0
0
I was able to until i bound the DataGridView to a Database. I don't know the code to fix it.

Here is my current code
Code:

    Private Sub DataGridView1_CellContentClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles ShoppingListView.CellContentClick
        If e.RowIndex >= 1 Then
            If e.ColumnIndex = ShoppingListView.Columns("clmDelete").Index Then
                If MessageBox.Show("Are you sure you want to delete?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then
                    mDataTable.Rows.RemoveAt(e.RowIndex)
                End If
            End If
        End If
    End Sub


Viewing all articles
Browse latest Browse all 27153

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>