vcl-cxgridcustomtableview-322766fb.md
The base class for all data items in Table, Banded Table, Card, Layout, and WinExplorer grid Views.
TcxCustomGridTableItem = class(
TcxComponent,
IcxEditRepositoryItemListener,
IcxStoredObject,
IdxScaleFactor,
IdxFilterableComponent,
IdxFilterImagesProvider,
IdxExcelFilterableComponent,
IdxCustomFunctionContainer,
IdxCustomFunctionFilterableComponent,
IdxDateTimeHandling,
IdxFilteringDateTimeHandling,
IdxGroupingDateTimeHandling,
IcxDataControllerSpreadSheetExpressionItem,
IdxAutomationElement,
IdxAISmartPasteItem
)
The TcxCustomGridTableItem class implements core functionality common to data items in all grid Views except for Chart in all supported data access modes. A data item is designed to display data of the same type. In bound and server data access modes, a data item corresponds to an individual dataset field.
Data items are main visual elements of all grid Views. Depending on the View type, data items describe different View elements:
Column
In a Table or Banded Table View, data items are columns that populate the View from left to right.
Card Row
In a Card View, items are card rows arranged vertically.
Layout Data Item
A layout data item is embedded into a layout container.
WinExplorer Data Item
A WinExplorer data item is an image, text, check box, or group associated with a dataset field.
A data item can use any editor shipped with the ExpressEditors Library as an in-place editor for cell edit operations. An in-place editor instance exists (and, therefore, has its own WinAPI handle) only when a data item cell is being edited. Otherwise, the data item displays a static editor image for resource usage optimization.
To switch between available in-place editors, you can use the PropertiesClass property. Use the Properties property to configure the in-place editor associated with the data item.
Alternatively, you can assign an edit repository item component to the RepositoryItem property, and use the repository item to define the active in-place editor and customize its settings.
Note
If an edit repository item is assigned to the RepositoryItem property, Properties, PropertiesClass, and PropertiesClassName properties have no effect.
You can handle OnGetProperties and OnGetPropertiesForEdit events to dynamically change the assigned in-place editor and its settings based on custom conditions.
Important
Do not change PropertiesClass, PropertiesClassName, and Properties property values directly in OnGetProperties and OnGetPropertiesForEdit event handlers.
To change the active editor and modify its settings safely within these event handlers, use the RepositoryItem property and TcxEditRepositoryItem class descendants.
The list below outlines key members of the TcxCustomGridTableItem class that allow you to configure columns, card rows, as well as layout and WinExplorer items in corresponding grid Views.
ApplyBestFit | BestFitMaxWidthAllow you to adjust the column width to display content in full and limit the maximum column width in this mode.Caption | AlternateCaptionSpecify main and alternative captions for the column. An alternative column caption can replace the main caption in customization dialogs, filter panels, etc.HeaderGlyph | HeaderImageIndexAllow you to assign a glyph to the column header.OnCustomDrawCellAllows you to override or complement column draw routines.OnGetDisplayText | OnGetFilterDisplayTextAllow you to customize display text and column captions displayed in a filter drop-down window.OnGetFilterImages | OnGetFilterValuesAllow you to customize the column’s filter drop-down window.StylesAllows you to customize the appearance of different data item elements.
AIProvides access to AI-powered functionality settings.EditingSpecifies if the assigned in-place cell editor is active.OnGetPropertiesAllows you to display different in-place editors for different records or customize editor settings based on custom conditions.OnGetPropertiesForEditAllows you to change the assigned in-place editor and customize its settings when a user invokes the editor.PropertiesProvides access to the settings of the assigned in-place editor.PropertiesClassSpecifies the active in-place editor class. At design time, you can use the Properties node in the Object Inspector to assign an in-place editor to the column and configure the editor.RepositoryItem
Allows you to associate the column with a repository item that defines the required in-place editor and its settings.
Tip
Repository items are particularly useful if you need to share in-place editor settings between multiple grid View items or customize editor settings in OnGetProperties and OnGetPropertiesForEdit event handlers.
DataBindingProvides access to data binding settings.GroupIndexAllows you to group columns in the parent grid View by the current column.SortIndex | SortOrderAllow you to sort data in the parent grid View against the current column.
FocusedSpecifies if the data item has focus.IndexDefines the data item position in its parent grid View.IsFirst | IsLastIdentify if the data item is the first or last in the parent grid View’s collection of visible data items.MakeVisibleScrolls the parent grid View to display the current data item.
EditableAllows you to identify if the data item is editable.GridViewProvides access to the parent grid View.OptionsAllows you to configure general data item settings.RestoreDefaultsRestores the default values of data item type-specific settings, such as Caption and Width. TcxCustomGridTableItem class descendants override this procedure with data item type-specific implementations.ShowExpressionEditorDisplays the Expression Editor dialog.[1]VisibleSpecifies if the data item is visible.
To delete a grid data item, release it directly in code (call the Free procedure in Delphi or use the delete keyword in C++Builder):
cxGrid1TableView1Column1.Free;
delete cxGrid1TableView1Column1;
Do not use the TcxCustomGridTableItem class directly. Use the following descendants instead:
TcxGridBandedColumnA column in an unbound Banded Table View.TcxGridCardViewRowAn unbound Card View row.TcxGridColumnA column in an unbound grid Table View.TcxGridLayoutViewItemA Layout View‘s data item.TcxGridWinExplorerViewItem
TcxGridDBCardViewRowA data-aware Card View row.TcxGridDBColumnA column in a data-aware grid Table View.TcxGridDBBandedColumnA column in a data-aware Banded Table grid View.TcxGridDBLayoutViewItemA data-aware Layout View’s data item.TcxGridDBWinExplorerViewItem
TcxGridServerModeColumnA column in a Server Mode grid Table View.TcxGridServerModeBandedColumnA column of a Banded Table View in Server Mode.
Show 11 items
IdxCustomFunctionFilterableComponent
TObject TPersistent TComponent TcxCustomComponent TcxComponent TcxCustomGridTableItem
Footnotes
See Also