VB.NET Events Failure

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top