TDBCtrlGrid

The TDBCtrlGrid is used to display the values associated with a DataSet (TDataSource) by placing various DB components on a panel. When the application is run, the panel is replicated with one copy per record. This is a great component for displaying more than one row of data - but, since there are numerous problems using this component, it is not so good for editing those rows.

I strongly suggest that you use a separate form (or dialog box) to create (insert) or edit records.

Overview | |


Overview

There is no good reference as to which components can be used with a DBCtrlGrid you just need to use trial an error. (huh) Basically, any component with csReplicatable in its ControlStyle property can be used. According to the Delphi 5 help, csReplicatable means

The control can be copied using the PaintTo method to draw its image to an arbitrary canvas.

Based on a search of the source code, these controls (and those based on them) are Replicatable

Notice that this list does not include any buttons.

To use a DBCtrlGrid, set its DataSource. This property is automatically locked to the DataSource properties of all the associated DB components - you will not be allowed to edit any individual DataSource properties, just the ONE associated with the DBCtrlGrid.

I am still trying to determine whether or not a TDBLookupComboBox component can be used - so far, I have not found a way to set the ListSource property.


Author: Robert Clemenzi - clemenzi@cpcug.org
URL: http:// cpcug.org / user / clemenzi / technical / Databases / Delphi / DBCtrlGrid.html