
(*
 Delphi Object and Component Reference
# {bmc bm9.BMP} ColCount, RowCount, Cells example
This code fills each cell with a number. The numbers are arranged in consecutive order by rows.
*) 
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  int I, J, K;
  K = 0;
  for (I = 0; I < StringGrid1->ColCount; I++)
    for (J = 0; J < StringGrid1->RowCount; J++)
      StringGrid1->Cells[I][J] = IntToStr(++K);
} 
