Skip to main content
Table of Contents

TTMSFNCDataGridDatabaseAdapter.OnFieldToData Event

Fires when a field value is read from the dataset to fill a grid cell.

API unit family: TMSFNCDataGridDatabaseAdapter Declaring type: TTMSFNCDataGridDatabaseAdapter Inherited from: TTMSFNCCustomDataGridDatabaseAdapter

Syntax

FMX.TMSFNCDataGridDatabaseAdapter.hppPascalC++
OnFieldToData: TTMSFNCDataGridDatabaseAdapterFieldToDataEvent;
__property TTMSFNCDataGridDatabaseAdapterFieldToDataEvent OnFieldToData = {read=FOnFieldToData, write=FOnFieldToData};

Remarks

Fires whenever the grid requests cell data, so it runs often while scrolling; keep the handler fast and do not navigate the dataset. It does not fire for null fields, templated columns, picture columns, ftBoolean fields shown as check boxes, or memo fields while ShowMemoFields is False.

By default the field's OnGetText result is used when assigned; otherwise the typed value is used, falling back to DisplayText for other field types. The reverse direction is OnDataToField.

Parameters

Name Description
Sender The adapter that fires the event.
ACell Grid cell being filled.
AMasterField For a lookup field, the key field that holds the lookup key; otherwise nil.
AField Field being read, positioned on the record of ACell.
ACellValue Assign the value the cell should hold.
Handled Set to True after assigning ACellValue to skip the default conversion.