Viewing and Editing Data with TDBGrid

From RAD Studio
Jump to: navigation, search

Go Up to Using data controls Index


A Vcl.DBGrids.TDBGrid control lets you view and edit records in a dataset in a tabular grid format.

Three factors affect the appearance of records displayed in a grid control:

  • Existence of persistent column objects defined for the grid using the Columns editor. Persistent column objects provide great flexibility setting grid and data appearance. For information on using persistent columns, see Creating a Customized Grid.
  • Creation of persistent field components for the dataset displayed in the grid. For more information about creating persistent field components using the Fields editor, see Working with Field Components.
  • The dataset's ObjectView property setting for grids displaying ADT and array fields. See Displaying ADT and Array Fields.

A grid control has a Columns property that is itself a wrapper on a TDBGridColumns object. Vcl.DBGrids.TDBGridColumns is a collection of TColumn objects representing all of the columns in a grid control. You can use the Columns editor to set up column attributes at design time, or use the Columns property of the grid to access the properties, events, and methods of TDBGridColumns at run time.

The following topics describe how to use the TDBGrid component:

See Also