//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "StringGridColCount.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: StringGridColCount
// Property: Grids.TCustomGrid.ColCount
// Property: Grids.TCustomGrid.RowCount
// Property: Grids.TStringGrid.Cells

// BeginCode
/*
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.
*/
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);
}
// EndCode
// EndExample: StringGridColCount
//---------------------------------------------------------------------------
