Are you issuing a
nodefault when trapping the delete key? I went back to my test form, and removed the nodefault I had put in the keypress event of grid1.column1.text1 and I'm now observing the same behavior. This code in the text1.keypress worked fine for me under VFP 6.0:
LPARAMETERS nKeyCode, nShiftAltCtrl
wait window str(nKeyCode) nowait
do case
case nkeycode = 7
delete
nodefault
case nkeycode = 22
append blank
nodefault
endcase
thisform.grid1.refresh
>Ken,
>
>I appreciate you sticking with me on this and I think I figured it out.
>
>My problem is that I want to do the deletion from within the grid by trapping the delete key in one column of the grid. If the deletion is WITHIN the grid & you are deleting the LAST row VFP6 rewrites ONLY the active remaining rows - not even a grid.refresh helps. I suppose they are saving a few clock cycles or something.
>
>The workaround is to setfocus to a control outside the grid the set it back to the grid AFTER the final row has been deleted.
>
>Once again thanks for your help.
kenweber
GCom2 Solutions
Microsoft Certified Professional