Hello Greg.
Unless I'm completely misunderstanding how the BeforeRowColChange and AfterRowColChange events work, I don't understand why the following doesn't work, ie. highlight the current row in a grid.Actually, I think that you are misunderstanding they way that these events fire as well as how DynamicBackColor works < s >
*nORecNo and nNRecNo are custom properties
*BeforeRowColChange
thisform.nORecNo=RECNO()
*AfterRowColChange
thisform.nNRecNo = RECNO()
thisform.grdSearch.SetAll("DynamicBackColor","iifthisform.nnrecno=thisform.norecno)," + ;
allt(str(RGB(0,255,0)))+ "," + allt(str(RGB(255,255,255))) + ")")The condition Thisform.nnRecNo = ThisForm.noRecNo will never evalutate to true. In the grid's BRCC, the record pointer is on RECNO( n ). In the grid's ARCC, the record pointer has moved and is now on RECNO( n + 1 ). If you want to highlight the current row in the grid, this code in the grid's init
This.nnRecNo = RECNO( This.RecordSource )
This.SetAll( 'DynamicBackColor', ;
'IIF( RECNO( This.RecordSource ) = This.nnRecNo, RGB( 0,255,255 ), RGB( 255, 255, 255 ) )', 'COLUMN' )
Then, in the Grid's ARCC:
Thisform.LockScreen = .T.
This.nnRecNo = RECNO( This.RecordSource )
This.Refresh()
Thisform.LockScreen = .F.
You only have to set the DynamicBackColor property once (i.e., in the grid's init). It is evaluated every time the grid is refreshed.