Results 1 to 2 of 2

Thread: [RESOLVED] Cancel DGV Row Delete

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2007
    Location
    Somewhere else today
    Posts
    355

    Resolved [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
    It was much easier in VB6, but I am now liking Vb.Net alot more.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2007
    Location
    Somewhere else today
    Posts
    355

    Re: Cancel DGV Row Delete

    Sorry Worked it out. All I had to do was fill the DGV again.

    Computerman.
    It was much easier in VB6, but I am now liking Vb.Net alot more.

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