Grid:Init dodefault() this.setall('DynamicForeColor', "this.myforecolor(BldMstr."+thisform.AddrField+")", 'Column') * .Setall('Sparse',.F.) set message to thisform.captionHere is myForeColor method of the grid:
******************************************************************** * Description.......: grdAddrStd.myForeColor - sets grid's forecolor depending on Status field value * Calling Samples...: * Parameter List....: * Created by........: Nadya Nosonovsky 06/29/01 11:31:54 PM * Modified by.......: ******************************************************************** lparameter tcFieldVal local lnColor if vartype(m.tcFieldVal)<>"C" tcFieldVal=evaluate('BldMstr.'+thisform.AdddrField) endif * -- changed the fore color of the whole row * -- red = auto suspect * -- blue = manually resolve * -- green auto-correct * -- highlight the selected line light blue ... *-------------------------------------------------------------------------- local lnColor do case case m.tcFieldVal='5' lnColor=rgb(255,0,0) && Auto-suspect case m.tcFieldVal='4' lnColor=rgb(0,128,0) && Auto-correct case m.tcFieldVal='6' && Manually-resolved lnColor=rgb(0,0,255) otherwise lnColor=rgb(0,0,0) && Black endcase return m.lnColorEach normal textbox in a grid I replaced with AddrInGrid class. In Town column I placed two controls: AddrInGrid (called text1) and cboTown1. In the grid Init I remove one of the objects depending on thisform.ProcType value.