Object Reference > True DBGrid Properties > DataView Property |
DataView Property
The DataView property returns or sets the method by which the grid will display data.
TDBGrid.DataView= value
Values
Design Time |
Run Time |
0 - Normal (default) |
dbgNormalView |
1 - Hierarchical |
dbgHierarchicalView |
2 - Group |
dbgGroupView |
3 - Form |
dbgFormView |
4 - Inverted |
dbgInvertedView |
Read/Write at run time and design time.
When set to 0 - Normal, the grid will only display flat files and will not support a hierarchical view. If the data source is a hierarchical recordset, the grid will only display data from the master table.
When set to 1 - Hierarchical, the grid will display recordsets in a hierarchical format. At run time, users can expand and collapse hierarchical recordset bands using a treeview-like interface.
For more information, see Hierarchical Data Display
When set to 2 - Group, a grouping area is created at the top of the grid; any columns that are placed into this area become part of the GroupColumns collection, forming a new split. When in group mode, grid columns can be moved into or out of the grouping area with the Add and Remove methods, respectively. Users can also perform this action by selecting and dragging a column into or out of the grouping area.
See Outlook-Style Grouping for more information.
When set to 3 – Form, the grid will display the recordset data in a convenient data entry form.
For more information, see Form Data Display.
When set to 4 – Inverted, the grid will flip the display, rows will be represented horizontally and columns vertically.
Note: Splits cannot be used when using the Inverted display option.
For more information, see Inverted Data Display.
Note
This property is only supported by the OLE DB version of True DBGrid Pro.
DataView 1 – Hierarchical can only be used in bound mode and has no effect in unbound or storage modes.