Hi All,
I have grid clas (specially Thanks from here for Nancy Folsom,Ed Rauh and Nadya Nosovosky for that class built) like behavior Delphi's DBGrid.(It uses Getfldstate() also TableUpdate(.t.) etc.. ) when presses DownArrow its adding new row to the grid and if Getfldstate(-1) anything changed deletes row or others situation.
Now i want to do this. i wantto use this actions with save,new buttons like Delphi's DBNavigator but how ? for eg.
when i press the DownArrow; SaveButton should be enabled and if I entered some data after Press UpArrow or DownArrow table should updated via TableUpdate(.t.) or if not changed anythings on at the new row and UpArrow Pressed ,TableRevert(.t.) routine should run and SaveButton should be disabled . And also this class can be use with textboxes not only with grid ... Sory if my explain was not complicated .I need some help if possible some samples about this matter...
TIA
FOR EACH oColumn IN this.Columns
WITH oColumn
.RemoveObject('Text1')
.NewObject('text1','GrdAddNew','sdbgrid.vcx')
.CurrentControl='Text1'
.text1.visible=.t.
ENDWITH
ENDFOR
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