TStringGrid.Onvalidate does not work correctly if the field was edited by directly typing new content
Original Reporter info from Mantis: jonas@freepascal.org
-
Reporter name: Jonas Maebe
Original Reporter info from Mantis: jonas@freepascal.org
- Reporter name: Jonas Maebe
Description:
If a cell in a stringgrid is selected and you just start typing content without first pressing return or double clicking the cell, the onvalidate handler gets the old value in both the OldValue and NewValue parameters.
Steps to reproduce:
a) compile and run the provided project
b) if none of the cells in the stringgrid is selected, click on one (once)
c) type any text, e.g.: a
d) press return
e) the message will show that the onvalidate handler was called with the empty string as both the old and the new value
f) if you type a new value in the same cell (reselecting it using the arrow keys) without activating the editor first via double-clicking or pressing return, you will get the previously entered value again as both old and new value
g) you you do press "return" or double click on a cell before entering a new value, then the correct values will be passed to onvalidate once you finish editing
Additional information:
The reason there are two columns with a different kind of editor is because before I discovered when exactly the problem occurred, I thought it only happened in with picklist cell editors. That's however not the case, it seems to be independent of the kind of editor.
Mantis conversion info:
- Mantis ID: 27955
- OS: OS X
- OS Build: 10.9.5
- Platform: Mac OS X
- Version: 1.4
- Fixed in version: 1.5 (SVN)
- Fixed in revision: 48872 (#ded4b23a)
- Target version: 1.6