Store a marker for the record the grid is at in the grid's tag property. It could be a recorrd number or key fields from the grid's data source.
The problem with those events is that they only address a column change, so you have to "cache" something to idendify when the row (or record) changes.
The before change method always seemed awkward:) With the afterchange, if there is a problem in the "row" just exited, the app can return to it by the "pointer" in the grid's tag. This code should work in BeforeRowChange:
LPARAMETERS nColIndex
with thisform
if transform(recno())#this.tag
if .SomeError()
goto val(this.tag)
else
this.tag=transform(recno())
endif
this.setfocus
else
Endif
Endwith
>Dear All,
>
>I would like to ask your advices on this:
>
>I have a grid to show records of my tables, before row change, it will check for any amendments made in the records, to move to another records.
>
>
>IF This.RowColChange = 1
> Thisform.changeorder
>ENDIF
>
>
>However, it seems that the grid would not remember the first focus record, i.e., when I switch between 2 pages in a pageframe, when I amend the record of first record in the grid, then move the pointer away from the record by mouse, the beforerowchange event is not firing up...
>
>I think I can use setfocus in Pageframe.Page.Activate, however, there are a lot of things download if I put focus in one of the records, and it seems to download the data twice...
>
>Any other means to solve this problem. Thanks in advance!
Imagination is more important than knowledge