I need to do a cell jump in an FMX TStringGrid. Before, I did it in a VCL application using this code:
StringGrid.Row := StringGrid.Row + 1;
StringGrid.Col := 1;
So, how do I do that in FMX?
I need to do a cell jump in an FMX TStringGrid. Before, I did it in a VCL application using this code:
StringGrid.Row := StringGrid.Row + 1;
StringGrid.Col := 1;
So, how do I do that in FMX?
Tom Brunberg
On
If you tried the same code in FMX, you might have been misguided by the fact that FMX doesn't indicate the selection automatically. You need to set the focus to the grid to see which cell is selected:
StringGrid1.Row := StringGrid1.Row+1;
StringGrid1.Col := 1;
StringGrid1.SetFocus;
Alternatively you can select a cell also with
StringGrid1.SelectCell(1, 2); // col, row
StringGrid1.SetFocus;
The exact same code should work in FMX too, as FMX's
TStringGridhas writableRowandColproperties, just like VCL'sTStringGridhas.