How to set focus on a specific row of the Grid?


Dear List,

How to set focus or highlight a specfic row in a Grid.

Thanx in Advance,





Active Member
I asked the same a couple of weeks ago, but nobody was
able to help me. I wanted to set the focus on the last
line of the grid, but It seems imposible.

Please Let me know if you find out how.

Ronnet Patino
OneWorld Developer
SQL 7.0 SP 2
Noritex - Panama


Legendary Poster
Hi K.J. Anand Kumar & Ronnet,

I really do not know that is a negative answer an answer for your issues. I launch this post just only do not leave this issue without some answer since a long time, although it will be a negative one.

Briefly: You can not put the focus to a specific row in the grid.
(... by my best knowledge).

I had made some experiments after I read these type of issues, playing with "Set Control Focus" and/or "Get Grid Row", etc. system functions to find some solution. Unfortunatelly I haven't found any and I was also waiting and hoping curiously that somebody will tell some solution.

At last let me some observation:
1.) One relevant information could be that on what type of form do you want to do that.
2.) Another and always relevant information is your system configuration information, mainly your OneWorld release level (e.g. If I am right, "SetControlFocus" system function does not exist prior B733). Please, put them next time into your posts. Thanks.

I am really very sorry.
It was just mine "minus" two cents.


B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)


Active Member
Click on it? Or if you want to process the line in ER you do the following;

Get Max Grid Rows(FC Grid, VA evt_mnMaxGridRecords_IA05)
While VA evt_mnGridCount_IA05 is less than or equal to VA evt_mnMaxGridRecords_IA05
Get Grid Row(FC Grid, VA evt_mnGridCount_IA05)
VA evt_mnGridCount_IA05 = [VA evt_mnGridCount_IA05]+1
// Do Some Things here
End While
// Or
// To go to the Last record directly
Get Grid Row(FC Grid, VA evt_mnMaxGridRecords_IA05)

This should do it.


Legendary Poster
Hi Xe_na_thanks,

You are right how to process any row in ER but I am afraid that the original issue is not this.

I was looking for BSFNs that could issue keystroke simulation but unfortunately I haven't found any.

Maybe a solution could be:
1.) Set Control Focus to the grid with system function call.
2.) Issue keystrokes from ER to go HOME or END (CTRL+HOM, CTRL+END) to a fix starting point.
3.) Issue keystrokes from ER to reach the desired row (UP or DOWN).

The ONLY open question: how can we issue keystrokes from ER?

Does anybody know any BSFN, system function to perform it (I haven't found)?
Does anybody know any API to perform it?
Does anybody know the way how to write a C++ BSFN to perform it?
Could it work at all to issue keystrokes somehow from ER?

Any further idea to resolve K.J. Anand's and Ronnet's issue (supposly not only theirs)?

Go ahead, do not leave unresolved problems ;-)


B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)


That is perfect for do something with the row, becouse the pointer is where
you need, but my case is diferent. I fill the grid row by row with insert
row grid buffer .... but theres a field the user have to complete, I want if
I filled the grid with 50 rows, the focus is positioned in that field in the
first row, so the user begin to complete all rows , instead the last row and
manualy have to move the cursor.


Active Member
Re: RE: How to set focus on a specific row of the Grid?

Look like I got the wrong end of the stick. I cannot think of a way to do it (not that that means much ;->) If you do come up with something do tell!