Skip to main content

Converting to ExpressQuantumGrid

  • 5 minutes to read

ExpressQuantumGrid provides an Import dialog at design time for importing settings from third-party grid controls and converting them to the native properties of the ExpressQuantumGrid. Three types of grid components can be imported to ExpressQuantumGrid:

You can use the links above for more information on importing from these specific grid controls.

Descendants of these grid controls can also be imported to ExpressQuantumGrid using the Import dialog. New properties (if there are any) that are declared in descendants will be ignored by the converter and no exception is raised in this case.

Data within the ExpressQuantumGrid is presented with the help of a View object. The converter creates a new View within the ExpressQuantumGrid for displaying the contents of the grid control being imported. The converter creates either a Table View (TcxGridDBTableView) or a Banded Table View (TcxGridDBBandedTableView) depending on the type of grid control being imported and that grid’s configuration:

Grid control An EQGrid View used to display the contents of the grid being imported
TdxDBGrid and TdxDBGridLayout A Table or Banded Table View is created depending on the grid’s properties.
TDBGrid A Table View.
TwwDBGrid A Banded Table View.

The look & feel of the ExpressQuantumGrid is maintained by a number of style properties. When a grid control being imported contains color and font attributes that are set to non-default values, these attributes are transformed into style objects. Once these styles have been created, they are assigned to the respective grid View elements. Note that importing styles is optional. You can disable this in the Import dialog.

To invoke the Import dialog, right-click the import target TcxGrid control and select the Import… option from the context menu. The panel on the left of the dialog lists all the supported grid components found in the current form.

The easiest way to perform the conversion is to double-click a source grid in this list or select the source grid and click the Import button.

This destroys all existing levels and Views in the target TcxGrid control and creates a new level-View pair for displaying data to match the source grid (levels and Views are discussed in the Data Representation topic). Then the converter imports columns and various grid properties (event handlers are not imported).

In addition, if a grid control contains color and font attributes set to non-default values, they are imported as EQGrid styles represented by TcxStyle objects and are applied to corresponding TcxGrid elements. By default, the converter creates a new style repository (a TcxStyleRepository component) for storing these styles.

The Levels and Styles pages allow you to customize the import process.

The Levels panel

The Levels panel displays the Structure Navigator which describes the logical structure of the grid’s levels. Each level is associated with a View displaying data from a specific data source. When importing a grid control, a new View is created to display its contents. You can use the Structure Navigator to specify the destination level for this View. The name of the currently selected destination level is displayed at the top of the Structure Navigator.

By default, the destination level is set to the target grid control itself meaning that the converter will create a new root level and associate a new View with it. The converter will also delete all other existing levels and Views.

You can set the destination level to any existing Level object (levels are painted within gray-blue boxes). This will destroy an old View linked to the level and will associate a new View with it.

The converter reads the Delete All Sublevels check box’s state to determine whether child levels need to be deleted when importing to a specific grid level. If the Delete All Sublevels is checked, all child levels (and their Views) at the currently selected destination level are disposed of. Otherwise, the child levels are not affected.

Importing grids to different grid levels allows you to establish master-detail and sibling relationships between data sources. Note that properties controlling the master-detail relationships must be set manually. You can refer to the Master-Detail section for more information.

The Styles panel

The Styles panel allows you to control the importing of color and font settings.

Unlike other grid controls, the appearance of the ExpressQuantumGrid is maintained by a number of style properties. Usually you create style objects (TcxStyle) via a style repository and assign them to style properties thus specifying the look & feel of the required elements. The converter will do this for you. It converts color and font attributes to style objects while adding them to a style repository. Styles are assigned to the corresponding style properties of the target grid control. Styles are not created for font and color attributes which are set to their default values.

Importing styles is optional. You can stop styles from being imported by unchecking the Import Styles check box. In this case, only properties that affect the representation of data are imported.

By default, styles are imported. You can choose between creating styles either within a new style repository or within an existing one. Selecting the Create New StyleRepository option enables the edit box. Use it to specify the name of the new style repository. The Use Existing StyleRepository option is a combo-box listing all the style repositories that can be found on the form.

You can refer to the tutorials shipped with the ExpressQuantumGrid which describe working with the Import dialog step by step.