Skip to main content

TcxCustomGridView.StoreToStorage(string,TcxCustomWriterClass,Boolean,TcxGridStorageOptions,string,string) Method

Saves grid View data layout and user interaction states to a file in a custom data format.

Declaration

procedure StoreToStorage(const AStorageName: string; AWriterClass: TcxCustomWriterClass; AReCreate: Boolean = True; AOptions: TcxGridStorageOptions = []; const ASaveViewName: string = ''; const AOwnerName: string = '');

Parameters

Name Type Description
AStorageName string

The target file. The file format depends on the writer class reference passed as the AWriterClass 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 TcxRegistryWriter class as the AWriterClass parameter.

AWriterClass TcxCustomWriterClass

A reference to the required writer class (a TcxCustomWriter class descendant).

The specified writer implementation saves grid View state information to the target file or system registry key passed as the AStorageName parameter.

AReCreate Boolean

Optional. Specifies if the procedure recreates the target file or system registry key (AStorageName) if it exists:

True
Default. The procedure deletes the target storage if it exists and creates a new file or system registry key with the same name.
False
The procedure adds grid View state information to the end of the target storage if it exists.
AOptions TcxGridStorageOptions

Optional. Specifies a set of individual user interaction states saved to the target file or system registry key (AStorageName).

If this parameter is omitted, the procedure saves only grid View structure information.

ASaveViewName string

Optional. Specifies the saved 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
Allows 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