Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Storing And Restoring The ExpressVerticalGrid Layout

  • 2 minutes to read

The ExpressVerticalGrid control provides a means to save and restore its layout. This functionality is encapsulated in a series of methods:

Method Description
StoreToIniFile Stores the vertical grid layout to an INI-file.
RestoreFromIniFile Restores the vertical grid layout from an INI-file.
StoreToRegistry Stores the vertical grid layout to a registry key.
RestoreFromRegistry Restores the vertical grid layout from a registry key.
StoreToStream Stores the vertical grid layout to a stream.
RestoreFromStream Restores the vertical grid layout from a stream.

The above mentioned methods save and restore the layout information, which includes:

Examples of saving the ExpressVerticalGrid layout are demonstrated below:

Delphi
cxDBVerticalgrid.StoreToIniFile('c:\storetest.ini');

The storetest.ini file portion is demonstrated below:

[cxDBVerticalGrid: TcxDBVerticalGrid]
=
HeaderWidth=220
ValueWidth=171
[cxDBVerticalGrid/0: TcxCategoryRow]
=
AParentID=-1
Index=0
Visible=True
Height=-1
Expanded=True
[cxDBVerticalGrid/1: TcxDBMultiEditorRow]
=
AParentID=0
Index=0
Visible=True
Height=-1
Expanded=True
[cxDBVerticalGrid/2: TcxDBMultiEditorRow]
=
AParentID=0
Index=1
Visible=True
Height=-1
Expanded=True
[cxDBVerticalGrid/3: TcxCategoryRow]
=
AParentID=-1
Index=1
Visible=True
Height=-1
Expanded=True
  • Using the StoreToRegistry method. Keep in mind, that this method by default stores the layout to the HKEY_CURRENT_USER registry key. The string parameter accepted by this method represents the registry key suffix.
Delphi
cxDBVerticalgrid.StoreToRegistry('VGrid\StoreTest');

The system registry key which represents the stored layout is demonstrated in the following screenshot:

Layout Stored as a Registry Key

Note

the number of rows within the vertical grid control must remain the same between saving and restoring, otherwise restoring will fail.