How to autocorrect a wrong input on a cell of DBGrid?
Posted on 2004-10-01
I want my DBGrid is able to autocorrect a wrong input on a cell
when the focus moves to a new cell. Currently, I've tried the
following techniques but it fails:
(1) Handling OnColExit event and do the correction when it's necessary. The problem is, OnColExit event only occurs if user move the focus to a new different column. This event doesn't occur if user move the focus to a different row at the same column.
(2) Handling TField.OnValidate event and do the correction when it's necessary. The problem is, it will continuously execute the TField.Onvalidate event because any writing to a cell will also execute the TField.OnValidate event.
Anybody here could tell me how the best way to do that?
Thank's in advance