[RESOLVED] Cancel DGV Row Delete
When a user wants to delete a row in a DGV, they are asked if they are sure they want to do it.
My question is how do I go about stopping the row from being deleted should they say no?
Code:
Private Sub RoomCodesDGV_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles RoomCodesDGV.KeyDown
Select Case e.KeyCode
Case Keys.Delete
If MsgBox("Are You Sure That You Want To Delete This Line? ", MsgBoxStyle.Question & MsgBoxStyle.YesNo, "Delete Room Code") = MsgBoxResult.No Then
??????
End If
End Select
End Sub
Any help would be appreciated.
Computerman :)
Re: Cancel DGV Row Delete
Sorry Worked it out. All I had to do was fill the DGV again.
Computerman. :)