在GRID的AfterRowColChange事件中录入以下代码试试(后面的颜色参数根据自己的需要修改):
LPARAMETERS nColIndex
local m_recn,m_recnnum,m_i
m_recn=recn()
M_RECNSTR=ALLTRIM(STR(M_RECN))
for m_i=1 to THIS.ColumnCount
this.columns[M_I].DynamicForeColor="IIf(recn()="+m_recnSTR+",RGB(255,255,255),RGB(0,0,0))"
this.columns[M_I].DynamicbackColor="IIf(recn()="+m_recnSTR+",RGB(0,0,0),RGB(255,255,255))"
endfor
THIS.REFRESH