>lcHost = THIS.chostname >lnColumn = THIS.PARENT.&lcHost..ActiveColumn >loControl = THIS.PARENT.&lcHost..Columns(lnColumn).Text1 >loControl.ForeColor = < your conditional color here or IIF returning it > >>
.newobject('grdBldMstr','grdSitus','AddrStd.vcx') endcase dodefault() && Will set proper filter && Nadya Nosonovsky 06/28/2001 09:50:17 PM .newobject("grdHglt1", "GrdHglt", "addrstd.vcx",, "grdBldMstr") with .grdBldMstr .left=1 .top=1 .width=min(m.lnFormWidth-5-m.lnEdtNotesWidth,.width) .height=m.lnFormHeight .visible=.t. * .setall('DynamicForeColor', "thisform.myforecolor(BldMstr."+thisform.AddrField+")", 'Column') endwithI moved last commented line into gridhighlighter OnPostSetDynamicColor method.
******************************************************************** * Description.......: AddrStdMain.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 column in the grid has only one control text1. Actually, that's not a normal text1, but my addrInGrid, which I placed here instead of text1. Sparse is set to .t. for all columns. When I'm sitting on the highllighted record, which has blue forecolor, the active column is displayed in black. I tried addrInGrid GotFocus event without any lack. My question is: is it possible to set gridhighlighting forecolor to be a function? Why GotFocus() doesn't work?