Problem/Question/Abstract:
How to delete a row in a TStringGrid
Answer:
procedure TForm1.BitBtn1Click(Sender: TObject);
var
i: Integer;
RowToBeDeleted: Integer;
begin
RowToBeDeleted := 3;
with StringGrid1 do
begin
Rows[RowToBeDeleted].Clear;
for i := RowToBeDeleted to RowCount - 2 do
begin
Rows[i].Assign(Rows[i + 1]);
end;
RowCount := RowCount - 1;
end;
end;
Nincsenek megjegyzések:
Megjegyzés küldése