Skip to main content

TcxCustomGridView.RestoreFromStorage(string,TcxCustomReaderClass,Boolean,Boolean,TcxGridStorageOptions,string,string) Method

Restores previously saved grid View state information from a file in a custom data format.

Declaration

procedure RestoreFromStorage(const AStorageName: string; AReaderClass: TcxCustomReaderClass; AChildrenCreating: Boolean = True; AChildrenDeleting: Boolean = False; AOptions: TcxGridStorageOptions = [gsoUseFilter, gsoUseSummary]; const ARestoreViewName: string = ''; const AOwnerName: string = '');

Parameters

Name Type Description
AStorageName string

The source file. The file format depends on the reader class reference passed as the AReaderClass parameter.

Note

The procedure interprets the AStorageName parameter value as a registry key (using HKEY_CURRENT_USER as root) if you pass a reference to the TcxRegistryReader class as the AReaderClass parameter.

AReaderClass TcxCustomReaderClass

A reference to the required reader class (a TcxCustomReader class descendant).

The specified reader implementation interprets content loaded from the source file or system registry key passed as the AStorageName property.

AChildrenCreating Boolean

Optional. Specifies if the procedure creates missing grid View elements (columns, bands, series, etc.):

True

Default. The procedure creates additional grid View elements to match the loaded structure state.

Tip

You can handle the OnInitStoredObject event to initialize created data items.

False
The procedure does not create any elements if the current structure contains fewer elements compared to the loaded structure state.
AChildrenDeleting Boolean

Optional. Specifies if the procedure deletes redundant grid View structure elements (columns, bands, series, etc.):

False
Default. The procedure does not delete any elements if the current structure contains more elements than the loaded structure state.
True
The procedure deletes all elements that do not correspond to the loaded structure state.

If the current grid View structure matches the loaded state, the AChildrenDeleting parameter is ignored.

AOptions TcxGridStorageOptions

Optional. Specifies a set of individual user interaction states restored from the source file or registry key (AStorageName).

If this parameter is omitted, the procedure loads only the grid View structure information, even if the specified source contains user interaction state information.

ARestoreViewName string

Optional. Specifies the source grid View name.

Use this parameter if you need to apply a saved state to a different grid View.

AOwnerName string

Optional. Specifies the parent form name for the TcxGrid control.

Tip

This parameter can be useful for MDI application projects.

Remarks

Call the StoreToStorage procedure to save specified data layout and user interaction states to a file in a custom data format. A subsequent RestoreFromStorage call restores the saved grid View state from the file.

Dedicated View State Store/Restore Methods

The TcxCustomGridView class also implements the following Store~/Restore~ method pairs suitable for most scenarios:

StoreToIniFile | RestoreFromIniFile
Allow you to store the grid View state (both data layout and user interaction states) in an INI file.
StoreToRegistry | RestoreFromRegistry
Allow you to store the grid View state (both data layout and user interaction states) in the system registry.
StoreToStream | RestoreFromStream
Allow you to store the grid View state (both data layout and user interaction states) in a stream.
StoreDataViewState | RestoreDataViewState
Allow you to store user interaction states in memory during the same session.
StoreDataViewStateToStream | RestoreDataViewStateFromStream
Allow you to store only user interaction states in a separate stream.
See Also