LOCAL oForm as Form oForm = CREATEOBJECT('TestForm') oForm.Show(1) RETURN DEFINE CLASS TestForm as Form CurrentValue = 0 AutoCenter = .T. PROCEDURE Load CREATE CURSOR temp (test Int) LOCAL i FOR i = 1 TO 5 INSERT INTO temp VALUES (1) INSERT INTO temp VALUES (2) INSERT INTO temp VALUES (3) ENDFOR GO TOP ENDPROC ADD OBJECT grdTest as Grid WITH ; Left = 10, Top = 10, ; Width = 350, Height = 220, ; Anchor = 15, ; RowSource = 'temp', ; ColumnCount = 1 PROCEDURE grdTest.Init This.SetAll('DynamicForeColor','This.DynamicX()','Column') ENDPROC PROCEDURE grdTest.DynamicX LOCAL lnColor lnColor = RGB(0,0,0) IF temp.test = Thisform.CurrentValue lnColor = RGB(255,0,0) ENDIF RETURN m.lnColor ENDPROC PROCEDURE grdTest.AfterRowColChange(nColIndex) Thisform.CurrentValue = temp.test This.Refresh() ENDPROC ENDDEFINE