Page 1 of 1

Set Focus to Cell in Grid

Posted: Tue Feb 12, 2019 3:18 am
by lawingo
Hopefully an easy Question:

I want to select the 1st Record in a grid and set focus to a cell in the 1st Row. In my example, the cell I want to set focus to is "GridColumn6". The code below selects the 1st record and it visually sets focus to the cell I want but I still have to click in the Cell in order to change it's value. I would like to have the value of the cell automatically selected. Thanks for your Help!

Code: Select all

* Select 1st Record
Selectlist Named(#GridMain)
Set Com(#GridMain.CurrentItem) Selected(True) Focus(True) Ensurevisible(True)
Leave
Endselect

Set Com(#GridColumn6.Cell<1>.Column) Focus(True) Selected(True) Ensurevisible(True)


Re: Set Focus to Cell in Grid

Posted: Wed Feb 13, 2019 9:54 am
by René Houba
Hi Lawingo,

After:
Set Com(#GridColumn6.Cell<1>.Column) Focus(True) Selected(True) Ensurevisible(True)

Do:
GridMain.SetFocus

Does that help?

Kind regards,
René

Re: Set Focus to Cell in Grid

Posted: Thu Feb 14, 2019 4:35 am
by lawingo
Bingo!

Thanks for your help.