TTMSFNCDataGridDatabaseAdapter.OnDataToField Event
Fires when an edited cell value is about to be written to its dataset field.
API unit family: TMSFNCDataGridDatabaseAdapter
Declaring type: TTMSFNCDataGridDatabaseAdapter
Inherited from: TTMSFNCCustomDataGridDatabaseAdapter
Syntax
OnDataToField: TTMSFNCDataGridDatabaseAdapterDataToFieldEvent;
__property TTMSFNCDataGridDatabaseAdapterDataToFieldEvent OnDataToField = {read=FOnDataToField, write=FOnDataToField};
Remarks
The dataset is already in edit (or insert) mode when this fires; the record is not posted by the adapter here. By default the adapter uses the key of the selected lookup item when the editor is a lookup combo box, calls the field's OnSetText when assigned, and otherwise assigns the value through AsVariant (AsDateTime for timestamp fields).
Use this to convert display formats back to stored values, for example to strip a currency symbol. The reverse direction is OnFieldToData.
Parameters
| Name | Description |
|---|---|
Sender |
The adapter that fires the event. |
ACell |
Grid cell whose value is being written. |
AMasterField |
For a lookup column, the lookup field itself; otherwise nil. |
AField |
Field that receives the value; for a lookup column, the key field of the edited dataset. |
AInplaceEditor |
In-place editor that produced the value, or nil. |
ACellValue |
The value to write. |
Handled |
Set to True after assigning AField yourself to skip the default assignment. |