Thanks for the help Sergey.
It didn't work but it gave me another ideas which work. I just add a line to scroll the grid up and now the first row gets in place as it should.
So, just to let you know the code nows look like this
ThisFormSet.EfrmSOrd.LockScreen = .t.
select thecursorname
This.EfrmSOrd.EpgfSOrd.PagDetail.EgrdDetail.Refresh()
This.EfrmSOrd.EpgfSOrd.PagDetail.EgrdDetail.SetFocus()
This.EfrmSOrd.EpgfSOrd.PagDetail.EgrdDetail.GrcItemNo.SetFocus()
This.EfrmSOrd.EpgfSOrd.PagDetail.EgrdDetail.doScroll(2)
Diane Robitaille eng.
Diane Robitaille eng.