[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'DBGrids' (#lcl)

# TComponentDataLink

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

Maintains an association between a component and a dataset.

## Declaration

Source position: dbgrids.pas line 191

`type TComponentDataLink = class(TDatalink)`
`protected`
`procedure RecordChanged(); override;` |  | Signals the OnRecordChanged event handler when assigned.
`procedure DataSetChanged; override;` |  | Signals the OnDatasetChanged event handler when assigned.
`procedure ActiveChanged; override;` |  | Signals an event handler when the Active property is changed.
`procedure LayoutChanged; override;` |  | Signals the OnLayoutChanged event handler when assigned.
`procedure DataSetScrolled(); override;` |  | Signals the OnDataSetScrolled event handler when assigned.
`procedure FocusControl(); override;` |  | Signals the OnFocusControl event handler when assigned.
`procedure CheckBrowseMode; override;` |  | Calls the inherited method.
`procedure EditingChanged; override;` |  | Signals the OnEditingChanged event handler when assigned.
`procedure UpdateData; override;` |  | Signals the OnUpdateData event handler when assigned.
`function MoveBy(); override;` |  | Moves the position in the dataset by the specified number of rows.
`property Modified: Boolean; [rw]` |  | Indicates if the component or the linked dataset has been changed.
`public`
`property OnRecordChanged: TFieldNotifyEvent; [rw]` |  | OnRecordChanged - event handler for a change in the current record.
`property OnDataSetChanged: TDatasetNotifyEvent; [rw]` |  | OnDataseChanged - event handler for a change in the attached dataset.
`property OnNewDataSet: TDataSetNotifyEvent; [rw]` |  | OnNewdataset - event handler for formation of a link to a new dataset.
`property OnDataSetOpen: TDataSetNotifyEvent; [rw]` |  | OnDataseOpen - event handler when the dataset is open.
`property OnInvalidDataSet: TDataSetNotifyEvent; [rw]` |  | OnInvalidDataset - event handler when the dataset is invalid.
`property OnInvalidDataSource: TDataSetNotifyEvent; [rw]` |  | OnInvalidDataSource - event handler when the data source is invalid.
`property OnFocusControl: TFocusControlEvent; [rw]` |  | Event handler signalled when the grid control receives focus.
`property OnLayoutChanged: TDataSetNotifyEvent; [rw]` |  | OnLayoutChanged - event handler when the layout of the dataset has changed.
`property OnDataSetClose: TDataSetNotifyEvent; [rw]` |  | OnDataseClose - event handler when the dataset is closed.
`property OnDataSetScrolled: TDataSetScrolledEvent; [rw]` |  | OnDataseScrolled - event handler when the dataset is scrolled.
`property OnEditingChanged: TDataSetNotifyEvent; [rw]` |  | Event handler signalled when the value for the Editing property has been changed.
`property OnUpdateData: TDataSetNotifyEvent; [rw]` |  | Event handler signalled to perform actions for pending changes to the linked dataset.
`property DataSetName: string; [rw]` |  | Contains the name for the linked dataset.
`property Fields []: TField; [r]` |  | Provides indexed access to fields in the linked dataset by their ordinal position.
`property VisualControl;`
`end;`

## Inheritance

`TComponentDataLink` |  | Maintains an association between a component and a dataset.
`TDatalink`
?
`TObject`

## Description

TComponentDataLink is a TDatalink descendant that maintains an association between a component and its linked dataset. TComponentDataLink coordinates the actions of the component and the dataset, and allows the component to respond to data events. TComponentDataLink defines event handlers which can be used to forward dataset events to the component implementation.

TComponentDataLink is the type used to implement the TCustomDBGrid.DataLink property.

## See also

TCustomDBGrid.DataLink |  | Datalink for the component with event handlers for the linked dataset.
TDataLink