Hi all,
Ive got a datagridview, which the user can put in to 'edit' mode by double clicking. If they then make changes but click to another row, I want to msg asking if they are sure they want to discard then changes. If they say No I want to stop the selection change from being made.
Code:Private Sub DataGridView1_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGridView1.SelectionChanged If edit = True Then Dim result As String = MsgBox("Are you sure you want to discard your changes?", MsgBoxStyle.YesNo) If result = vbYes Then clearedit() Else 'Here is where I need to cancel the selection change End If Else clearedit() End If




Reply With Quote