From 6b2c95df1480d30a95b8a654a68afbc20ca1e0cb Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Tue, 2 Dec 2008 23:14:53 +0000 Subject: [PATCH] Fix access violation on actived grid editors (enum, date, set) when the grid got reloaded. Fixes bug #893 and bug #883. --- source/childwin.pas | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/childwin.pas b/source/childwin.pas index 3c811589..eb987de7 100644 --- a/source/childwin.pas +++ b/source/childwin.pas @@ -1328,6 +1328,11 @@ begin viewingdata := true; sl_query := TWideStringList.Create(); + // Ensure grid has left editing mode so DataGrid.OnNewText applies its changes + // to the old data, not to the new or some non referenced data + if DataGrid.IsEditing then + DataGrid.EndEditNode; + // Post pending update and set post + cancel buttons to valid state if DataGridHasChanges then Mainform.actDataPostChangesExecute(Sender);