Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete from Grid
Message
From
18/02/2011 09:43:31
 
 
To
18/02/2011 09:22:13
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01500698
Message ID:
01500704
Views:
71
Tariq,

Instead of calling DELETE right away, you can call a method.

So, if the grid you are using is your own subclass, you can put a method in it like say, DeleteRecord(). You may also create this method in your form class if you prefer.

So, the following lines will be on your WHEN event of grid would look like:
ON KEY LABEL CTRL+D This.DeleteRecord()
And DeleteRecord() would look like:
IF MESSAGEBOX( "Are you sure to delete current record?", 4+32, "Confirm Deletion" ) = 6
    DELETE
ENDIF
Hope to help.
Dennis


>Dear Experts
>
>I have following codes in VALID event of grid
>
>ON KEY LABEL CTRL+D 
>
>
>then following lines is on WHEN event of grid
>
>ON KEY LABEL CTRL+D DELETE
>
>
>When user press CTRL+D then current record is deleted.
>
>I want to displays this message box before deletion
>
>Are you sure to delete current record?
>
>What will be the best procedure to delete from grid with confrirmation messagebox.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform