Data.DB.TDataSource.OnDataChange
Delphi
property OnDataChange: TDataChangeEvent read FOnDataChange write FOnDataChange;
C++
__property TDataChangeEvent OnDataChange = {read=FOnDataChange, write=FOnDataChange};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
event | published | Data.DB.pas Data.DB.hpp |
Data.DB | TDataSource |
Description
Occurs when the data in a record has changed, either due to field edits or moving the cursor to a new record.
Write an OnDataChange event handler to take specific actions when a field in the current record has been edited and the application moves to another field, or when the current record in the associated dataset changes. OnDataChange is especially useful in applications that must synchronize data display in controls that are not data-aware. This event is typically used to make sure the control reflects the current field values in the dataset, because it is triggered by all changes.
Methods that can trigger this event include the Next or Prior methods for the dataset. Data-aware controls notify a data source of a data change when:
Scrolling to a new record.
Modifications to a field's data.
OnDataChange is an event handler of type Data.DB.TDataChangeEvent.