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
Column width. Can be set to automatic (default) or a custom value in pixels or percentage.
Text and formatting properties to display the column name at TeeGrid headers. Contains the column’s display text and visual styling.
Optional collection of sub-columns. Enables hierarchical column structures where columns can contain nested columns.
Controls visibility of column sub-columns. When
true, displays the column’s sub-columns if they exist.Controls column visibility. When
false, the column is not displayed in the grid.Enables or disables editing of grid cell content using the keyboard. When
true, cells cannot be edited.Controls whether the column can be selected by the user.
When
true, inherits formatting from the parent column or grid.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
Custom brush, stroke, and font properties for the column. Defines the visual appearance of column cells.
Edge spacing inside grid cells. Controls padding within cells.
Horizontal and vertical text alignment within cells.
Column text alignment mode:
Automatic: Automatically aligns based on data type (e.g., right-align numbers)Custom: Uses theTextAlignproperty
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
Optional custom render instance used to paint column cell contents. Enables custom drawing logic.
Custom user-defined object associated with the column. Useful for storing additional metadata.
Key Methods
Returns
true if the column can be displayed (is visible and has valid width).Returns
true if the column has sub-columns in its Items collection.Returns the hierarchical level of the column. Top-level columns return 0, their children return 1, etc.
Returns the right edge position of the column (Left + Width).
Returns the effective horizontal alignment for the column based on
TextAlignment setting and data type.Returns the parent
TColumns collection that owns this column.Events
Event triggered when painting the column. Allows custom painting logic.
Usage Example
Hierarchical Columns
Columns can contain sub-columns through theItems property:
