Creating a Grid That Contains Other Data-aware Controls

From RAD Studio
Jump to: navigation, search

Go Up to Using data controls Index

A Vcl.DBCGrids.TDBCtrlGrid control displays multiple fields in multiple records in a tabular grid format. Each cell in a grid displays multiple fields from a single row.

To use a database control grid

  1. Place a database control grid on a form.
  2. Set the DataSource property of the grid to the name of a data source.
  3. Place individual data controls within the design cell for the grid. The design cell for the grid is the top or leftmost cell in the grid, and is the only cell into which you can place other controls.
  4. Set the DataField property for each data control to the name of a field. The data source for these data controls is already set to the data source of the database control grid.
  5. Arrange the controls within the cell as desired.

When you compile and run an application containing a database control grid, the arrangement of data controls you set in the design cell at run time is replicated in each cell of the grid. Each cell displays a different record in a dataset.


The following table summarizes some of the unique properties for database control grids that you can set at design time:

Selected database control grid properties :

Property Purpose


True (default): Permits record deletion.False: Prevents record deletion.


True (default): Permits record insertion.False: Prevents record insertion.


Sets the number of columns in the grid. Default = 1.


goVertical (default): Display records from top to bottom.goHorizontal: Displays records from left to right.


Sets the height for an individual panel. Default = 72.


Sets the width for an individual panel. Default = 200.


Sets the number of panels to display. Default = 3.


True (default): Displays a focus rectangle around the current record's panel at run time.False: Does not display a focus rectangle.

See Also