This example displays a message that asks the user to confirm a deletion in a grid.
Private Sub DataGrid1_BeforeDelete (Cancel As Integer)
Dim mResult As Integer
mResult = MsgBox("Are you sure that you want to delete " & DataGrid1.SeletedRows & " record?", _
vbYesNo And vbQuestion, "Delete Confirmation")
If mResult = vbNo Then Cancel = True
End Sub