From 51367feff0954658f5d4aea4c2590cf53ecd5317 Mon Sep 17 00:00:00 2001 From: juha Date: Tue, 26 Sep 2017 16:48:05 +0000 Subject: [PATCH] LCL: In TDBGrid prevent "Grid index out of range" when dgRowSelect in options and tab or enter pressed. Issue #32468, patch from Michal Gawrycki. git-svn-id: trunk@55931 - --- lcl/dbgrids.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lcl/dbgrids.pas b/lcl/dbgrids.pas index 83e51b37ab..016c59414b 100644 --- a/lcl/dbgrids.pas +++ b/lcl/dbgrids.pas @@ -2396,7 +2396,7 @@ begin begin doOnKeyDown; if (Key<>0) and ValidDataset then begin - if dgTabs in Options then begin + if (dgTabs in Options) and not (dgRowSelect in Options) then begin if ((ssShift in shift) and (Col<=GetFirstVisibleColumn) and (Row<=GetFirstVisibleRow)) then begin @@ -2428,7 +2428,7 @@ begin key:=0; if (dgEditing in Options) and not EditorMode then EditorMode:=true - else begin + else if not (dgRowSelect in Options) then begin GetDeltaMoveNext(ssShift in Shift, DeltaCol, DeltaRow, AutoAdvance); MoveSel(True); end;