TcxCustomTreeList.OnSetStoredPropertyValue Event
Enables you to restore tree list property values from external data stores.
Declaration
property OnSetStoredPropertyValue: TcxSetStoredPropertyValueEvent read; write;
Remarks
This event is fired for each property 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 tree list 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 tree list’s OptionsView.Footer and OptionsView.GroupFooters property values previously saved within the tree list’s OnGetStoredPropertyValue event handler.
procedure TMyForm.cxTreeList1SetStoredPropertyValue(Sender: TObject; const AName: String; const AValue: Variant);
begin
if Sender is TcxCustomTreeList then
begin
if AName = 'OptionsView_Footer' then
begin
TcxCustomTreeList(Sender).OptionsView.Footer := AValue;
Exit;
end;
if AName = 'OptionsView_GroupFooters' then
begin
TcxCustomTreeList(Sender).OptionsView.GroupFooters := AValue;
Exit;
end;
end;
end;
Note
To properly initialize columns that are created during the restore process, handle the OnInitStoredObject event.