Vcl.Grids.TStringGrid.Objects

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Objects[ACol, ARow: Integer]: TObject read GetObjects write SetObjects;

C++

__property System::TObject* Objects[int ACol][int ARow] = {read=GetObjects, write=SetObjects};

Properties

Type Visibility Source Unit Parent
property public
Vcl.Grids.pas
Vcl.Grids.hpp
Vcl.Grids TStringGrid

Description

Lists the objects for each cell in the grid.

Use the Objects property to access the object associated with a particular cell. The ColCount and RowCount properties (inherited from TCustomGrid) define the size of the array of objects. ACol is the column coordinate of the cell, and ARow is the row coordinate of the cell, where the first column is column 0, and the first row is row 0.

Add an object to the Objects array like this:

MyStringGrid.Objects[i,j]:= TMYThing.Create(); //Delphi
MyStringGrid->Objects[i][j] = new TMYThing(); //C++

Note: The string grid does not own the objects in the Objects array. Objects added to the Objects array still exist even if the string grid is destroyed. They must be explicitly destroyed by the application.

See Also

Code Examples