Hi All,
Grid AllowAddNew property still behaviour earlier versions ,
How ? if its .T. grid adding new rows when user press downarrow at the last row on the grid but i heard that it would behaviour delphi's dbgrid or MSAccess grid. Eg. when user press down arrow at the last row will add a new row if nothing happen or changed any fields on the new row and user press up arrow will undo (or delete ) . But i've tried it seems still same.
is there any info about this ? . This feature very usefull coming to me specially at the OneToMany forms to enter detail input. Why not in VFP like delphi or access ?
TIA
PS : I've solved this problem ( via Ed Rauh :(,Nadya and Nancy) with my method but not useful sometimes for eg. i am using textbox class on the grid textbox class uses keypress event for do this action . But init code removes text1's . is there any short way without remove columns and add new textbox class to all columns then change some columns currentcontrol for use requiered keypress event codes ?
my code like below
FOR EACH oColumn IN this.Columns
WITH oColumn
.RemoveObject('Text1')
.NewObject('text1','GrdAddNew','sdbgrid.vcx')
.CurrentControl='Text1'
.text1.visible=.t.
ENDWITH
ENDFOR
LPARAMETERS nKeyCode, nShiftAltCtrl
LOCAL lcAlias
lcAlias = THIS.PARENT.PARENT.RECORDSOURCE
DO CASE
CASE nKeyCode = 24
IF GETFLDSTATE(-1) = REPLICATE("3",FCOUNT(lcAlias)+1)
NODEFAULT
ENDIF
CASE nKeyCode = 5
IF GETFLDSTATE(-1) = REPLICATE("3",FCOUNT(lcAlias)+1)
TABLEREVERT(.F., lcAlias)
THIS.PARENT.PARENT.REFRESH
ENDIF
ENDCASE