StringGridColCount (Delphi)
Description
This code fills each cell with a number. The numbers are arranged in consecutive order by rows. Notice that even cells in the fixed rows and columns are altered.
Code
procedure TForm1.Button1Click(Sender: TObject);
var
I, J, K : Integer;
begin
K := 0;
with StringGrid1 do
for I := 0 to ColCount - 1 do
for J:= 0 to RowCount - 1 do
begin
K := K + 1;
Cells[I,J] := IntToStr(K);
end;
end;
Uses
- Vcl.Grids.TCustomGrid.ColCount ( fr | de | ja )
- Vcl.Grids.TCustomGrid.RowCount ( fr | de | ja )
- Vcl.Grids.TStringGrid.Cells ( fr | de | ja )