This event fires when you click in the delete mark column in a grid.
PROCEDURE grdGrid.Deleted
LPARAMETERS nRecNoThe name Deleted is a little misleading, because the event fires whenever you click in the delete mark column, whether you're deleting or recalling the record. The record number of the affected record is passed to nRecNo.
Use NODEFAULT in the method to prevent the deletion or recall. Better yet, set DeleteMark to .F. and the user can't delete records in the grid at all.
PROCEDURE Deleted
* Confirm the deletion.
LPARAMETERS nRecNo
LOCAL nResult
* In this example, the message uses the record number.
* In an application, you'd use data from the record.
nResult = MESSAGEBOX("Do you really want to delete record?" ;
+ LTRIM(STR(nRecNo)), MB_YESNO + MB_ICONQUESTION)
IF nResult = IDNO
NODEFAULT
ENDIF
ENDPROC