Overview
TColumn defines the properties used to paint rows of a TeeGrid column. It includes support for hierarchical columns through the Items property, which can contain sub-columns.
Key Properties
TColumnWidth
Column width. Can be set to automatic (default) or a custom value in pixels or percentage.
TColumnHeader
Text and formatting properties to display the column name at TeeGrid headers. Contains the column’s display text and visual styling.
TColumns
Optional collection of sub-columns. Enables hierarchical column structures where columns can contain nested columns.
Boolean
default:"true"
Controls visibility of column sub-columns. When
true, displays the column’s sub-columns if they exist.Boolean
default:"true"
Controls column visibility. When
false, the column is not displayed in the grid.Boolean
default:"false"
Enables or disables editing of grid cell content using the keyboard. When
true, cells cannot be edited.Boolean
default:"true"
Controls whether the column can be selected by the user.
Boolean
default:"true"
When
true, inherits formatting from the parent column or grid.TDataFormat
Formatting strings for numbers and date-time data types. Controls how data values are displayed in cells.Includes properties:
Float: Format string for floating-point numbers (default:"0.###")Date: Format string for date valuesDateTime: Format string for date-time valuesTime: Format string for time values
TFormat
Custom brush, stroke, and font properties for the column. Defines the visual appearance of column cells.
TMargins
Edge spacing inside grid cells. Controls padding within cells.
TTextAlign
Horizontal and vertical text alignment within cells.
TColumnTextAlign
default:"Automatic"
Column text alignment mode:
Automatic: Automatically aligns based on data type (e.g., right-align numbers)Custom: Uses theTextAlignproperty
TColumnLocked
default:"None"
Locks the column to a specific position:
None: Column scrolls normallyLeft: Column is locked to the left sideRight: Column is locked to the right side
TRender
Optional custom render instance used to paint column cell contents. Enables custom drawing logic.
TObject
Custom user-defined object associated with the column. Useful for storing additional metadata.
Key Methods
Boolean
Returns
true if the column can be displayed (is visible and has valid width).Boolean
Returns
true if the column has sub-columns in its Items collection.Integer
Returns the hierarchical level of the column. Top-level columns return 0, their children return 1, etc.
Single
Returns the right edge position of the column (Left + Width).
THorizontalAlign
Returns the effective horizontal alignment for the column based on
TextAlignment setting and data type.TColumns
Returns the parent
TColumns collection that owns this column.Events
TColumnPaintEvent
Event triggered when painting the column. Allows custom painting logic.
Usage Example
Hierarchical Columns
Columns can contain sub-columns through theItems property:
