StringGridColCount (C++)
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
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);
}
Uses
- Vcl.Grids.TCustomGrid.ColCount ( fr | de | ja )
- Vcl.Grids.TCustomGrid.RowCount ( fr | de | ja )
- Vcl.Grids.TStringGrid.Cells ( fr | de | ja )