VB.NET Events Failure

  • Thread starter Thread starter LucaJonny
  • Start date Start date
L

LucaJonny

Hi,
I've got a big problem!
I've written an application in VB.NET that read some data from an
Access database.
I've used DataTable object with its events (RowChanging, RowChanged,
etc.).
When the user changes someting in a row and goes to another row,
RowChanging event fire:

Private Sub MyDataTable_RowChanging(ByVal sender As Object, ByVal e As
System.Data.DataRowChangeEventArgs) Handles MyDataTable.RowChanging
Dim ret As MsgBoxResult
ret = MsgBox("Save changes?", MsgBoxStyle.YesNoCancel)
If _
ret = MsgBoxResult.Yes _
Then
' ... accept changes (and continue!!)
If _
ret = MsgBoxResult.No _
Then
' ... reject changes (and continue!!)
Else
' I want keep this row until user don't choose Yes or No
End If
End Sub

How can I fail the event execution??
It's possible??
Any ideas!
Thanks, LucaJonny
 
I assume your question revolves around what to do when the "Cancel" button is
clicked. If you want to hold onto the data in the row when that button is
clicked how 'bout simply copying the DataRow from the DataTable into a new
DataRow instance.

How is the functionality of clicking the "No" button different than that for
clicking "Cancel?"

..ARN.
 
Back
Top