Stringgrid validate How ? lazarus / 16-Databases ---------------------------------------------------------------------- k1attila1 · 2014-11-28 11:25 Hi Stringgrid : How can i validate the content of a cell and how can i prevent to move to the next cell if the result of validate is FALSE. thanks ---------------------------------------------------------------------- Blaazen · 2014-11-28 11:43 You can use event OnValidateEntry. If NewValue is not valid, you can change it to OldValue or to some valid default value. Although I don't know how to prevent the move (other than setting AutoAdvance to aaNone). ---------------------------------------------------------------------- k1attila1 · 2014-11-28 12:12 So, Abort; method in OnValidateEntry prevent to leave the actual cell. But using Abort; procedure in Lazarus very chaotic. for example : Field.OnValidate - Abort doesn't prevent to leave the actual dbcontrol Edit.onExit - ABORT doesn't prevent to move the cursor to the next field etc.... Sometimes works , sometimes not.... ---------------------------------------------------------------------- Blaazen · 2014-11-28 17:29 IMO Abort; is not intended to be used in GUI apps.at all. ---------------------------------------------------------------------- taazz · 2014-11-29 00:26 Quote from: Blaazen on November 28, 2014, 06:29:21 pmIMO Abort; is not intended to be used in GUI apps.at all. Abort is the only silent exception that the library supports it is supposed to be used everywhere. The problem is that when an event is raised does it give the ability to the end user to stop the action in its tracks? If not why not? ---------------------------------------------------------------------- k1attila1 · 2014-11-29 09:12 for example work well Abort : - DataSet : -beforedelete                 -beforeinsert                 - beforepost                   etc. But not work absoultely in visual components (which have text input tedit, tmemo, tdbedit etc. ) - onexit method ---------------------------------------------------------------------- mangakissa · 2014-12-01 08:09 use stringgrid as readable records. For editing use Other GUI controls which are not related to multiple records.