[SOLVED] Making Lazarus dbGrid act like Delphi on data entry lazarus / 16-Databases ---------------------------------------------------------------------- eshjim · 2016-08-06 18:19 When appending a new record to the end of a dbGrid, in Delphi, after completing the last field, a tab automatically inserts a new blank record with the focus on the first field of the record. This enables fast data entry. However, in Lazarus, a tab after the last field is completed moves the cursor to the next object in the tab order. In the grid, the focus stays on the newly inserted record. Is there any way of making Lazarus emulate Delphi either at design time or in code? ---------------------------------------------------------------------- eshjim · 2016-08-06 18:49 After a little more playing about, I solved it  For any other Lazarus newbies that may be interested, this is the code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TfmMain.DBGrid1KeyDown(Sender: TObject; var Key: Word;  Shift: TShiftState); begin  if Key = VK_TAB then    if DBGrid1.SelectedIndex = 2 then // grid has 3 fields        begin          dmData.SQLDetail.Append;          DBGrid1.SelectedIndex := 0;        Key := 0; // prevents tab from operating and taking cursor to                  // second field of new record        end;end; My problem previously was that I was over-coding, which just goes to show that sometimes less is more!! ---------------------------------------------------------------------- shobits1 · 2016-08-06 22:49 I tracked down the problem and I think it's small bug, experienced developer, please confirm: lazarus\lcl\dbgrids.pas ,, around line: 2369 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if (not (ssShift in Shift)) and (Row>=GetLastVisibleRow) and   (DeltaRow>0) and (Col=GetLastVisibleColumn) and   (FDatalink.Editing or not GridCanModify) then begin  {$ifdef dbgGrid}DebugLnExit('%s.KeyDown Exit: Tab: not shift',[ClassName]);{$endif}  exit;end;  should be changed to : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if (not (ssShift in Shift)) and (Row>=GetLastVisibleRow) and   (DeltaRow>0) and (Col=GetLastVisibleColumn) and   (not GridCanModify) then begin  {$ifdef dbgGrid}DebugLnExit('%s.KeyDown Exit: Tab: not shift',[ClassName]);{$endif}  exit;end;  as you can see,, it checks if row/record is in edit mode and since new row/record is always in edit mode, therefor it's bug.