[SOLVED] StringGrid insert row fails lazarus / 31-LCL ---------------------------------------------------------------------- VB_Lazarus · 2020-03-21 10:04 Hello, I have some problems with insert a row and then select it. I want to duplicate a row. I got the failure "insert out of range", although the selection is between the first and the last row. Not outside. 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 TfrmMain.Button_DuplizierenClick(Sender: TObject);var   ColumSelect : integer;   RowSelect : integer;   CellText : string;begin  RowSelect := StringGrid_ImportDatei.Row;  showmessage(IntToStr(StringGrid_ImportDatei.RowCount));   StringGrid_ImportDatei.InsertColRow(false,RowSelect+1);  showmessage(IntToStr(StringGrid_ImportDatei.RowCount));   for ColumSelect := 1 to StringGrid_ImportDatei.ColCount-1 do      begin       CellText:= StringGrid_ImportAnsicht.Cells[ColumSelect,RowSelect + 1];         StringGrid_ImportAnsicht.Cells[ColumSelect,RowSelect] := CellText;      end;end;                             What is wrong with this code. Best regards ---------------------------------------------------------------------- eljo · 2020-03-21 10:31 which grid raises the error? StringGrid_ImportAnsicht or StringGrid_ImportDatei? ---------------------------------------------------------------------- VB_Lazarus · 2020-03-21 10:49 Thank you, this was the answer. I'm so stupid. I didn't saw the difference. I need only the StringGrid_ImportDatei. I have to change the StringGrid_ImportAnsicht to StringGrid_ImportDatei and the code is correct. Best regards.