RAD Studio
ContentsIndex
PreviousUpNext
Creating a Grid That Contains Other Data-aware Controls

A 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 grid's DataSource property 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 runtime 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 
AllowDelete  
True (default): Permits record deletion.
False: Prevents record deletion.  
AllowInsert  
True (default): Permits record insertion.
False: Prevents record insertion.  
ColCount  
Sets the number of columns in the grid. Default = 1.  
Orientation  
goVertical (default): Display records from top to bottom.
goHorizontal: Displays records from left to right.  
PanelHeight  
Sets the height for an individual panel. Default = 72.  
PanelWidth  
Sets the width for an individual panel. Default = 200.  
RowCount  
Sets the number of panels to display. Default = 3.  
ShowFocus  
True (default): Displays a focus rectangle around the current record's panel at runtime.
False: Does not display a focus rectangle.  
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!