Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you handle Grid Delete Column/Method?
Message
From
06/05/1998 09:10:43
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00096634
Message ID:
00097282
Views:
20
>
>Dragan is fairly correct in that this is the behaviour I observe. However, to overcome the problems, I have had to eliminate the delete column and add a delete button. When you click the little delete square, the deleted() method fires, but the actual delete of the record does not occur until after the method completes. I have tried DoDefault(), etc., including deleting the record number passed to the method. What then shows on the grid, when I issue a delete, are 2 deleted records -- the one I deleted and the next or previous record. The behaviour is totally unpredictable (at least to me).
>
>However, I did not use Dragan's exact suggestion, which I will try (I left off the nodefault at the end):
>
>dodefault()
>do_my_code_here
>nodefault

Next try is

if deleted()
recall
else
delete
endif
do_the_other_stuff_here
nodefault

This way we handle the deletion ourselves. Deleting two records instead of one.... hmm, it's kind of contradictory; as if there was some Set Deleted On/Off swapping during the method execution (both the default and/or custom).

Made myself smile for a moment: instead of "if deleted()... recall... else... delete... endif" I started typing "this.deleted=!this.deleted". An unintentional prophecy?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform