TcxPivotGridCustomDataSet.OnCreateField Event
Enables you to perform specific actions after a field has been created in the current dataset.
Declaration
property OnCreateField: TcxPivotGridDataSetFieldEvent read; write;
Remarks
This event is fired by the CreateData method.
The Sender parameter specifies the current dataset.
The APivotGridField parameter identifies the pivot grid field that corresponds to the created dataset field, which is passed as the ADataSetField parameter.
The following code demonstrates how to handle the OnCreateField event to match a dataset field’s size to a pivot grid field’s size in a data-aware pivot grid.
procedure <TForm>.PivotGridDataSetCreateField(
Sender: TcxPivotGridCustomDataSet; APivotGridField: TcxPivotGridField;
ADataSetField: TField);
begin
ADataSetField.Size := TcxDBPivotGridField(APivotGridField).DataBinding.DBField.Size;
end;
See Also