You can use the grid Options property at design time to control basic grid behavior and appearance at runtime. When a grid component is first placed on a form at design time, the Options property in the Object Inspector is displayed with a + (plus) sign to indicate that the Options property can be expanded to display a series of Boolean properties that you can set individually. To view and set these properties, click on the + sign. The list of options in the Object Inspector below the Options property. The + sign changes to a –(minus) sign, that collapses the list back when you click it.
The following table lists the Options properties that can be set, and describes how they affect the grid at runtime.
Expanded TDBGrid Options properties
Option |
Purpose |
dgEditing |
True: (Default). Enables editing, inserting, and deleting records in the grid. False: Disables editing, inserting, and deleting records in the grid. |
dgAlwaysShowEditor |
True: When a field is selected, it is in Edit state. False: (Default). A field is not automatically in Edit state when selected. |
dgTitles |
True: (Default). Displays field names across the top of the grid. False: Field name display is turned off. |
dgIndicator |
True: (Default). The indicator column is displayed at the left of the grid, and the current record indicator (an arrow at the left of the grid) is activated to show the current record. On insert, the arrow becomes an asterisk. On edit, the arrow becomes an I-beam. False: The indicator column is turned off. |
dgColumnResize |
True: (Default). Columns can be resized by dragging the column rulers in the title area. Resizing changes the corresponding width of the underlying TField component. False: Columns cannot be resized in the grid. |
dgColLines |
True: (Default). Displays vertical dividing lines between columns. False: Does not display dividing lines between columns. |
dgRowLines |
True: (Default). Displays horizontal dividing lines between records. False: Does not display dividing lines between records. |
dgTabs |
True: (Default). Enables tabbing between fields in records. False: Tabbing exits the grid control. |
dgRowSelect |
True: The selection bar spans the entire width of the grid. False: (Default). Selecting a field in a record selects only that field. |
dgAlwaysShowSelection |
True: (Default). The selection bar in the grid is always visible, even if another control has focus. False: The selection bar in the grid is only visible when the grid has focus. |
dgConfirmDelete |
True: (Default). Prompt for confirmation to delete records (Ctrl+Del). False: Delete records without confirmation. |
dgCancelOnExit |
True: (Default). Cancels a pending insert when focus leaves the grid. This option prevents inadvertent posting of partial or blank records. False: Permits pending inserts. |
dgMultiSelect |
True: Allows user to select noncontiguous rows in the grid using Ctrl+Shift or Shift+ arrow keys. False: (Default). Does not allow user to multi-select rows. |
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|