Try putting this in your grid's refresh method...
*IF ALL ROWS CAN FIT IN THE GRID, THEN REFRESH SO YOU CAN SEE ALL RECORDS
LOCAL ScrnLocked
ScrnLocked = THISFORM.LOCKSCREEN
IF NOT ScrnLocked
THISFORM.LOCKSCREEN=.T.
ENDIF
WITH THIS
SELECT (.RECORDSOURCE)
STORE RECNO() TO lnRecno
IF RECCOUNT()< FLOOR((.HEIGHT-.HEADERHEIGHT-IIF(BITAND(.SCROLLBARS,1)=1, SYSMETRIC(8), 0))/.ROWHEIGHT)
GO TOP
DODEFAULT()
ENDIF
ENDWITH
LOCATE RECORD (lnRecno)
DODEFAULT()
IF NOT ScrnLocked
THISFORM.LOCKSCREEN=.F.
ENDIF
>Hello Folks,
>
>I have a grid which is used as list box or read only implmented originally in VFP 6.0 to highlight the selected record using the IIF with dynamic and foreground colors set for selected record in the Init of the Grid, I need to highlight the last record as opposed to the first one upon launching the form.
>
>First time I launch the form with 5 or so records (Grid display area not full), it highlights the last record and all other records are shown, the way I want it.
>
>Successive lanuches would show only the last record with the scroll bar on which you you have to click to show all previous records.
>
>I use ActivateCell to activate the last record and the grid in a form based class object which is instantiated to an object under _screen object. I use VFP 8.0 under Windows XP.
>
>Any solution for this inconsistent behaviour?
>
>Many thanks!