LCL: DBGrid: Fixed pressing RETURN in the last row of the DBGrid the focus stay in the last column. Issue #33294

git-svn-id: trunk@57458 -
This commit is contained in:
michl 2018-03-06 19:41:20 +00:00
parent 196ca5e7fd
commit 40285d1653

View File

@ -2381,6 +2381,8 @@ var
end; end;
procedure MoveSel(AReset: boolean); procedure MoveSel(AReset: boolean);
var
ACol: Integer;
begin begin
if (DeltaCol<>0) or (DeltaRow<>0) then begin if (DeltaCol<>0) or (DeltaRow<>0) then begin
if DeltaRow > 0 then begin if DeltaRow > 0 then begin
@ -2398,7 +2400,16 @@ var
else if Col + DeltaCol >= ColCount then else if Col + DeltaCol >= ColCount then
Col := ColCount - 1 Col := ColCount - 1
else else
Col := Col + DeltaCol; begin
ACol := Col + DeltaCol;
if ColWidths[ACol] > 0 then
Col := ACol
else
if DeltaCol < 0 then
Col := GetFirstVisibleColumn
else
Col := GetLastVisibleColumn;
end;
GridFlags := GridFlags - [gfEditingDone]; GridFlags := GridFlags - [gfEditingDone];
end else end else
if AReset then if AReset then