TcxCustomGridColumn Class
Declaration
TcxCustomGridColumn = class(
TcxCustomGridTableItem
)
Remarks
The TcxCustomGridColumn
class implements core functionality common to all Table and Banded Table grid Views in all supported data access modes. A column displays data of the same type in a table. In bound and server data access modes, a column corresponds to an individual dataset field.
A column can use any editor from the ExpressEditors Library as an in-place editor for cell edit operations. To switch between available editors, you can use the PropertiesClassName or PropertiesClass property. Use the Properties property to configure the active in-place editor.
Main API Members
The list below outlines key members of the TcxCustomGridColumn
class that allow you to configure columns in Table and Banded Table grid Views.
- Fix a column or dock it to the left when users scroll the grid’s Table View to the right (FixedKind).
- Identify if the column is selected (Selected).
- Specify a caption for the column (Caption).
- Configure data binding settings in the current data access mode (DataBinding).
- Hide or display the column (Visible).
- Switch between available in-place editor types (PropertiesClass and PropertiesClassName).
- Configure the assigned in-place editor (Properties and RepositoryItem).
- Sort data against the column (SortIndex and SortOrder).
- Group columns in the grid Table or Banded Table View (GroupIndex).
- Scroll the grid Table or Banded Table View to display the column (MakeVisible).
- Display custom cell value display text (OnGetDisplayText).
- Configure column summaries (Summary).
- Customize the appearance of column elements (Styles).
- Position column footer cells (FooterAlignmentHorz).
- Specify if the column is visible in an in-place Edit Form and the custom row layout (VisibleForEditForm and VisibleForRowLayout).
- Access the layout item that hosts the column’s editor in an in-place Edit Form (LayoutItem).
- Identify the column’s position in the grid View or a band (IsBottom, IsLeft, IsMostBottom, IsMostLeft, IsMostRight, IsRight, and IsTop).
- Assign a glyph to the column header (
HeaderGlyph
and HeaderImageIndex). - Customize column appearance and behavior settings (Options).
- Position the glyph within the column header (HeaderGlyphAlignmentHorz and HeaderGlyphAlignmentVert).
- Configure the column’s container item in a custom row layout (RowLayoutItem).
- Identify if the column has a preview section (IsPreview).
- Access the grid Table View to which the column belongs (GridView).
Example: Create an Unbound Column
The following code example creates an unbound Table View column (TcxGridColumn), assigns a spin in-place editor to it, and limits the input value range.
uses cxSpinEdit;
// ...
var
AColumn: TcxGridColumn;
ASpinEditProperties: TcxSpinEditProperties;
begin
AColumn := cxGrid1TableView1.CreateColumn; // Creates a new unbound column
AColumn.DataBinding.ValueType := 'Integer'; // Changes the column value type to "Integer"
AColumn.PropertiesClass := TcxSpinEditProperties; // Assigns an in-place spin editor
ASpinEditProperties := AColumn.Properties as TcxSpinEditProperties;
ASpinEditProperties.MinValue := 0; // Sets the minimum edit value
ASpinEditProperties.MaxValue := 20; // Sets the maximum edit value
ASpinEditProperties.Circular := True; // Loops value changes within the defined range
end;
Terminal TcxCustomGridColumn Class Descendants
Do not use the TcxCustomGridColumn
class directly. Use the following descendants instead:
- TcxGridColumn
- An item (column) in a Table View.
- TcxGridBandedColumn
- A column within a Banded Table View.
- TcxGridDBColumn
- A column in a data-aware grid Table View.
- TcxGridDBBandedColumn
- A banded column in a data-aware Banded Table View (TcxGridDBBandedTableView).
- TcxGridServerModeColumn
- A column in a Server Mode Table View.
- TcxGridServerModeBandedColumn
- A column within a Banded Table View with support for server mode.