VCL Delphi

{ 1. Code }
procedure TForm1.Button1Click(Sender: TObject);
var
i, k: Integer;
begin
with StringGrid1 do
for i := 0 to ColCount - 1 do
for k := 0 to RowCount - 1 do
Cells[i, k] := '';
end;
{ 2. Code }
// Many times faster!
// Um einiges schneller!
procedure TForm1.Button2Click(Sender: TObject);
var
I: Integer;
begin
for I := 0 to StringGrid1.RowCount - 1 do
StringGrid1.Rows[I].Clear();
end;