Skip to main content

TcxCustomGridView Class

The base class for all grid Views.

Declaration

TcxCustomGridView = class(
    TcxControlChildComponent,
    IcxStoredObject,
    IcxStoredParent,
    IcxGridViewLayoutEditorSupport,
    IdxAdornerTargetElement,
    IdxAutomationElement
)

Remarks

The TcxGrid control relies on Views (TcxCustomGridView descendants) to connect to data as well as manage and display it in various formats. Each available grid View type implements a specific data display layout (a table, card, chart diagram, custom layout, etc.) and corresponding end-user interaction options.

VCL Data Grid: A Grid Table View Example

Available Views

Table View: Unbound | Bound | Server Mode
A simple table, similar to a data grid (a TCustomGrid descendant) found in the standard VCL library.
Banded Table View: Unbound | Bound | Server Mode
A table data layout that allows you to group columns into higher-level headers (bands).
Card View: Unbound | Bound
Displays each record in a block similar to a contact card.
Layout View: Unbound | Bound
Displays each record as a card with a customizable layout.
Chart View: Unbound | Bound
Displays data as bar, column, line, area, or pie diagrams. One grid Chart View can display only one diagram at a time.
WinExplorer View: Unbound | Bound
Supports the same data display modes as those found in Microsoft Windows Explorer: Small, Medium, Large, Extra-Large, List, and Content.

Main API Members

The list below outlines key members of the TcxCustomGridView class. These members allow you to manage grid View states and configure base settings.

Appearance Settings

Images
Allows you to assign an image source for data item headers.
OptionsView
Provides access to grid View element appearance settings.
ShowHourglassCursor | HideHourglassCursor
Allow you to display or hide the hourglass cursor (for time-consuming operations).
Styles
Provides access to a style collection that allows you to override appearance settings for individual grid View elements.

Behavior Settings

DragMode
Specifies the operation that starts a drag-and-drop operation in the grid View.
OptionsSelection
Provides access to selection-related behavior options.
PopupMenu
Allows you to associate the grid View with a pop-up menu component.
TabStop
Specifies if users can navigate to the grid View using the Tab keystroke.

State Management APIs

OnGetStoredProperties | OnGetStoredPropertyValue | OnInitStoredObject | OnSetStoredPropertyValue
Allow you to customize grid View state store/restore operations.
StoreDataViewState | RestoreDataViewState
Store/restore only user interaction states (selection, focus, the scroll position, etc.) in memory during the same session.
StoreDataViewStateToStream | RestoreDataViewStateFromStream
Store/restore only user interaction states (selection, focus, scroll position, etc.) in a separate stream. These methods complement StoreToStream and RestoreFromStream.
StoreToIniFile | RestoreFromIniFile
Store/restore the grid View state (both data layout and user interaction states) in an INI file.
StoreToRegistry | RestoreFromRegistry
Store/restore the grid View state (both data layout and user interaction states) in the system registry.
StoreToStream | RestoreFromStream
Store/restore the grid View state (both data layout and user interaction states) in a stream.

User Interaction Events

OnDblClick | OnMouseDown | OnMouseEnter | OnMouseLeave | OnMouseMove | OnMouseUp | OnMouseWheel | OnMouseWheelDown | OnMouseWheelUp
Allow you to execute custom code in response to mouse actions in the grid View.
OnDragDrop | OnStartDrag | OnDragOver | OnEndDrag
Allow you to respond to drag & drop operations or prevent them.
OnKeyDown | OnKeyPress | OnKeyUp
Allow you to respond to keystrokes while the grid View has focus.

Grid View Data Structure APIs

Clones
Provides indexed access to all existing clones of the current grid View.
CloneCount
Returns the total number of clone grid Views accessible through the Clones property.
IsDetail | IsMaster | IsPattern | HasAsClone | HasAsMaster
Allow you to identify the grid View role in a full data structure.
Level
Provides access to the parent grid View level.
PatternGridView
Provides access to the pattern grid View (if the current grid View is a clone).
Site
Provides access to the parent container (a grid site) of the current grid View.
Synchronization

Specifies if all clones of the current detail grid View are synchronized automatically with their pattern grid View.

Note

This setting is in effect only for detail grid Views in a master-detail relationship.

General-Purpose API Members

AssignSettings | Assign | AssignTo
Copy compatible settings between grid Views (terminal TcxCustomGridView descendant instances).
BeginUpdate | EndUpdate | CancelUpdate
Allow you to avoid excessive redraw operations during batch data and appearance changes.
Controller
Allows you to imitate user actions in code (scroll content, navigate between data items, start/cancel search operations, etc.).
DataController

Provides access to the underlying data controller designed for all data shaping and management operations.

Note

Different TcxCustomGridView class descendants use different data controller types depending on their data access mode (Unbound, Bound/Data-Aware, or Server).

Focused
Specifies if the grid View has focus.
Invalidate | LayoutChanged | ViewChanged
Redraw grid View content.
RestoreDefaults
Restores default settings for the grid View.
Visible
Specifies if the grid View is visible.

Direct TcxCustomGridView Class References

All public APIs in this section reference a grid View as a TcxCustomGridView object. To access all public API members of an individual grid View, cast a returned object to the corresponding terminal TcxCustomGridView descendant.

TcxCustomGrid.ActiveView
Provides access to the View associated with the currently active root grid level.
TcxCustomGrid.CreateView
Creates a View of a specified class and adds it to the View list.
TcxCustomGrid.Views
Specifies the list of all Views contained within a grid control.
TcxGridLevel.GridView
Specifies the View associated with the current level.
TcxCustomGridViewClass

Terminal TcxCustomGridView Class Descendants

Do not use the TcxCustomGridView class directly. Use the following descendants instead:

Unbound Grid Views

TcxGridBandedTableView
A View that groups columns into bands.
TcxGridCardView
A Card grid View.
TcxGridChartView
A grid Chart View.
TcxGridLayoutView
An unbound Layout grid View.
TcxGridTableView
An unbound Table View in the VCL Data Grid.
TcxGridWinExplorerView
An unbound WinExplorer View.

Data-Aware Grid Views

TcxGridDBBandedTableView
A data-aware Banded Table View.
TcxGridDBCardView
Represents a data-aware Card View.
TcxGridDBChartView
A data-aware grid chart View.
TcxGridDBLayoutView
A data-aware Layout View.
TcxGridDBTableView
A bound Table View in the VCL Data Grid.
TcxGridDBWinExplorerView
A data-aware WinExplorer View.

Server Mode Grid Views

TcxGridServerModeBandedTableView
The Banded Table View that provides support for server mode.
TcxGridServerModeTableView
The Table View that provides support for server mode.
See Also