Skip to main content

TcxCustomPivotGrid.OnSetStoredPropertyValue Event

Enables you to restore property values from external data stores.

Declaration

property OnSetStoredPropertyValue: TcxSetStoredPropertyValueEvent read; write;

Remarks

This event is fired for each property (including default properties) within the list specified in the OnGetStoredProperties event handler. Handle the OnSetStoredPropertyValue event to restore custom property values that were explicitly specified via the OnGetStoredPropertyValue event handler.

The Sender parameter specifies the pivot grid whose properties are restored.

The AName parameter identifies the property name. Its value is returned by the AValue parameter. Use this value to assign a corresponding property.

The following code represents an OnSetStoredPropertyValue event handler demonstrating how to restore the pivot grids OptionsView.ColumnGrandTotals and OptionsView.RowGrandTotals property values previously saved within the pivot grid’s OnGetStoredPropertyValue event handler.

procedure <Form>.<PivotGrid>SetStoredPropertyValue(Sender: TObject; const AName: String; const AValue: Variant);
begin
  if Sender is TcxCustomPivotGrid then
  begin
    if AName = 'OptionsView_ColumnGrandTotals' then
    begin
      TcxCustomPivotGrid(Sender).OptionsView.ColumnGrandTotals := AValue;
      Exit;
    end;
    if AName = 'OptionsView_RowGrandTotals' then
    begin
      TcxCustomPivotGrid(Sender).OptionsView.RowGrandTotals := AValue;
      Exit;
    end;
  end;
end;

Note

To properly initialize fields that are created during the restoring process, handle the OnInitStoredObject event.

See Also