I am using a FMX.Grid.TGrid
in which a user can select complete rows. In some cases I want to reset this selection. If I do this with grid.selected = -1
or with grid.selectRow(-1)
the selection is removed from the grid but grid.selected
is set to '0' (in TCustomGrid.SelectCell
), which is the first row.
How can i reset the selection so that the property grid.selected
is '-1'?
I checked code of FMX library I did tiny class helper, which allow you to get direct access to private property which are store value of selected row. Tested on Delphi XE8. This code will work correctly, even if you have options "AlwaysShowSelection" enabled.