Data.DB.TDataSetField.Create

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

constructor Create(AOwner: TComponent); override;

C++

__fastcall virtual TDataSetField(System::Classes::TComponent* AOwner);

Properties

Type Visibility Source Unit Parent
constructor public
Data.DB.pas
Data.DB.hpp
Data.DB TDataSetField

Description

Creates and initializes a TDataSetField instance.

Most applications do not explicitly create instances of TDataSetField. Instead, the field components are created automatically, as persistent field components defined in the Fields editor at design time or as dynamic field components created automatically by the dataset.

Create sets the DataType property to ftDataSet. The AOwner parameter specifies the component, typically a dataset, that becomes the new field's Owner. The Owner is responsible for freeing the component.

In the rare cases when you must create a persistent field component at runtime, call Create to create and initialize an instance of TDataSetField. After instantiating a TDataSetField, associate it with a specific field by setting its FieldName property to the name of the field. Give the TDataSetField a unique identifier in the Name property. Establish where the field appears in the collection of fields by providing an ordinal number in the Index property. Specify the dataset that contains the dataset field by setting its DataSet property.

See Also