PUBLIC oform1 oform1=NEWOBJECT("form1") oform1.Show RETURN DEFINE CLASS form1 AS form DataSession = 2 Height = 225 Width = 301 DoCreate = .T. AutoCenter = .T. Caption = "Form1" Name = "Form1" ADD OBJECT command2 AS commandbutton WITH ; Top = 193, ; Left = 18, ; Height = 27, ; Width = 46, ; Caption = "<", ; Name = "Command2" ADD OBJECT command3 AS commandbutton WITH ; Top = 193, ; Left = 75, ; Height = 27, ; Width = 46, ; Caption = ">", ; Name = "Command3" ADD OBJECT command5 AS commandbutton WITH ; Top = 193, ; Left = 225, ; Height = 27, ; Width = 46, ; Cancel = .T., ; Caption = "Exit", ; Name = "Command5" ADD OBJECT grdz AS grid WITH ; ColumnCount = 3, ; DeleteMark = .F., ; Height = 111, ; Left = 9, ; Panel = 1, ; RecordSource = "z", ; RecordSourceType = 1, ; ScrollBars = 2, ; Top = 6, ; Width = 285, ; AllowCellSelection = .F., ; Name = "grdZ", ; Column1.ControlSource = "z.f1", ; Column1.Width = 84, ; Column1.Name = "Column1", ; Column2.ControlSource = "z.f2", ; Column2.Width = 84, ; Column2.Name = "Column2", ; Column3.ControlSource = "z.f3", ; Column3.Width = 84, ; Column3.Name = "Column3" ADD OBJECT txtf1 AS textbox WITH ; Comment = "", ; ControlSource = "z.f1", ; Height = 23, ; Left = 18, ; TabIndex = 8, ; Top = 139, ; Width = 81, ; Name = "txtF1" ADD OBJECT txtf2 AS textbox WITH ; Comment = "", ; ControlSource = "z.f2", ; Height = 23, ; Left = 105, ; TabIndex = 10, ; Top = 139, ; Width = 81, ; Name = "txtF2" ADD OBJECT txtf3 AS textbox WITH ; Comment = "", ; ControlSource = "z.f3", ; Height = 23, ; Left = 192, ; TabIndex = 12, ; Top = 139, ; Width = 81, ; Name = "txtF3" ADD OBJECT txtdatetime AS textbox WITH ; Height = 23, ; Left = 18, ; TabIndex = 12, ; Top = 167, ; Width = 255, ; Name = "txtDatetime" ADD OBJECT check1 AS checkbox WITH ; Top = 119, ; Left = 20, ; Height = 17, ; Width = 120, ; AutoSize = .T., ; BackStyle = 0, ; Caption = "AllowCellSelection", ; ControlSource = "thisform.grdz.allowcellselection", ; Name = "Check1" PROCEDURE Load local lnCnt create cursor z(f1 i, f2 i, f3 i) for lnCnt=1 to 5 insert into z values (lnCnt, lnCnt+1, lnCnt+2) endfor go top ENDPROC PROCEDURE command2.Click if recno()>1 skip -1 endif *thisform.Refresh && this does NOT fire AfterRowColChange regardless of allowcellselection thisform.grdZ.SetFocus && this does NOT fire AfterRowColChange for allowcellselection .F. && I know why (the cell cannot get focus) && But the AfterRowColChange should fire when the row changes *thisform.grdZ.afterrowcolchange && this works for allowcellselection .F., is it the right thing to do? ENDPROC PROCEDURE command3.Click if recno()<5 skip 1 endif *thisform.Refresh && this does NOT fire AfterRowColChange regardless of allowcellselection thisform.grdZ.SetFocus && this does NOT fire AfterRowColChange for allowcellselection .F. && I know why (the cell cannot get focus) && But the AfterRowColChange should fire when the row changes *thisform.grdZ.afterrowcolchange && this works for allowcellselection .F., is it the right thing to do? ENDPROC PROCEDURE command5.Click thisform.Release ENDPROC PROCEDURE grdz.AfterRowColChange LPARAMETERS nColIndex thisform.txtDatetime.Value = transform(f1) + ' - ' + transform(seconds()) thisform.Refresh ENDPROC ENDDEFINE>>A couple of grid questions: