Environment: TMS VCL UI Pack 13.5.6, Delphi 13 (Florence), Windows 11, Win32.
We are migrating a large application from Delphi XE5 (older TMS VCL UI Pack) to Delphi 13 with TMS VCL UI Pack 13.5.6. We have many data-entry AdvStringGrids where the user types a value and presses Enter to move through the columns. Our application performs per-column logic in code and moves the cursor itself (grid.Col := grid.Col + 1).
In the previous version, on Enter our OnKeyPress handler read grid.Col / grid.Row as the cell that was just edited, ran the per-column logic, and advanced the cursor.
In 13.5.6 we observe (consistent with this thread: AdvStringGrid issue with OnKeyPress event and AdvanceOnEnter ) that on Enter, OnKeyDown moves to the next cell first, then OnKeyPress fires with grid.Col / grid.Row already pointing to the next cell. So our handler now reads the wrong column. In addition, for single-line cells, Enter does not end the edit on the first keypress when AdvanceOnEnter is False (the edit only commits on a second Enter); when AdvanceOnEnter is True, the grid advances one cell and our code advances another, skipping a column.
Questions:
- Is there a supported property/option to make a single-line cell commit and end its edit on a single Enter WITHOUT auto-advancing to the next cell? We need commit-only; our application controls the navigation.
- With the current event ordering, what is the recommended/supported way to obtain the just-edited cell (ACol/ARow) and run custom per-cell logic on Enter? Should we move our logic to OnEditCellDone or OnCellValidate, and is there a way to restrict that to the Enter key only?
- Given that we have many such grids, is there any global setting to restore the previous Enter commit / event-timing behavior?
Minimal repro: a grid with goEditing and one editable single-line column. Type a value, press Enter, and log grid.Col in OnKeyPress — it reports the next cell, not the edited one (matching the referenced thread).
Thank you.