[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'DB' (#fcl)

# TMasterDataLink

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Datalink for Master-Detail relationships between datasets.

## Declaration

Source position: db.pas line 1855

`type TMasterDataLink = class(TDetailDataLink)`
`public`
`constructor Create(); virtual;` |  | Create a new instance of TMasterDataLink
`destructor Destroy; override;` |  | Free the datalink instance from memory
`property FieldNames: string; [rw]` |  | List of fieldnames that make up the master-detail relationship
`property Fields: TList; [r]` |  | List of fields as specified in FieldNames
`property OnMasterChange: TNotifyEvent; [rw]` |  | Called whenever the master dataset data changes
`property OnMasterDisable: TNotifyEvent; [rw]` |  | Called whenever the master dataset is disabled
`end;`

## Inheritance

`TMasterDataLink` |  | Datalink for Master-Detail relationships between datasets.
`TDetailDataLink` |  | Represents the link between a detail data source and a master datasource.
`TDataLink` |  | Data event handling agent for controls
`TPersistent,IFPObserved`
`TObject`

## Description

TMasterDataLink is a TDatalink descendent which handles master-detail relations. It can be used in TDataset descendents that must have master-detail functionality: the detail dataset creates an instance of TMasterDataLink to point to the master dataset, which is subsequently available through the TDataLink.Dataset property.

The class also provides functionality for keeping a list of fields that make up the master-detail functionality, in the TMasterDatalink.FieldNames and TMasterDataLink.Fields properties.

This class should never be used in application code.

## See also

TDataset |  | Base class for records-based data-access
TDatalink.DataSource |  | Datasource this datalink is connected to
TDatalink.DataSet |  | Dataset this datalink is connected to
TMasterDatalink.FieldNames |  | List of fieldnames that make up the master-detail relationship
TMasterDataLink.Fields |  | List of fields as specified in FieldNames

Documentation generated on: May 14 2021