Hi Fabio,
I've not tried it, but you might want to (mis)use the dynamicBackColor (or any other Dynamic Propery) to do this.
When you do a refresh of the grid the command stored in that property is evaluated from the top row to the bottom.
THISFORM.Init
THISFORM.Grid.Column1.DynamicBackColor = "THISFORM.GetFirstRow(RECNO('YourCursorSource'))"
THISFORM.GetFirstRow
LPARAMETER nRecno
IF EMPTY(THISFORM.FirstRow)
THISFORM.FirstRow = nRecno
ENDIF
RETURN RGB(255,255,255)
THISFORM.Grid.Refresh
THISFORM.FirstRow = 0
All you have to do now is a
THISFORM.Grid.Refresh
to get your first row
As I said, I never tried it, but it might work.
Walter,
>Problem:
>
>I want know this ( like a FirstRow property ):
>
>the Recno(grid.RecordSource) that occupies the first row of the grid visible area
>>
>
>a) grid is not active, and i cannot change the focus
>
>
>I found no solutions.
>
>
>b) Focus on grid and grid have the Active row out of Rows visible Area.
>
>
>I found a solution with ActivateCell(1,m.this.ActiveColumn)
>
>
>c) Conditions b) and without move the record bookmark
>
>
>I have found only a linear search with DoScroll,
>but the direction it is unknown, then the search is very inefficient.
>
>Thanks