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.
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