[SOLVED]DBGrid, the cursor won't move to the persistent field. lazarus / 31-LCL ---------------------------------------------------------------------- Focus77 · 2020-06-08 20:14 Hi every body! I have a dbgrid with 5 fields+a persistent field. Autoadvance is at aaRightDown. I  use RETURN to move between the columns . But when the cursor is on the fifth column, it would not move to the persistent one. is it a bug? ---------------------------------------------------------------------- jamie · 2020-06-08 21:12 Isn't a persistent field a Read only? if so then what good would be the cursor there ? ---------------------------------------------------------------------- Focus77 · 2020-06-08 21:40 Hi there Of course the persistent field is a read only, but the cursor must cross it, in order to get the next row. for this I used the next 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 TF_MAINFORM.DBGrid2KeyDown(Sender: TObject; var Key: Word;  Shift: TShiftState);begin  if key=VK_RETURN then     if DBGrid2.SelectedColumn.Index=4 then      DBGrid2.SelectedIndex:=5;end; ---------------------------------------------------------------------- jamie · 2020-06-08 22:04 maybe you should be cycling the columns each time you move up or down and always check for the field type and if not desirable then go to the next one until you fine one that is ..  if you come to the end before you find one then you just don't move … ---------------------------------------------------------------------- Focus77 · 2020-06-09 20:53 Hi every one ! @jamie In fact the only fields I can input the data are 1,2 and 3. the code became: 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 TF_MAINFORM.DBGrid2KeyDown(Sender: TObject; var Key: Word;  Shift: TShiftState);begin  if key=VK_RETURN then     if DBGrid2.SelectedColumn.Index<3 then      DBGrid2.SelectedIndex:=DBGrid2.SelectedIndex+1      else      begin    DBGrid2.SelectedIndex:=1;      if not MDT.T_NOTE.EOF      then MDT.T_NOTE.Next      end; end;