ThgColumn Properties

ThgColumn is derived from ThgHeading and supports all of its properties. For more information on columns and headings see Columns.


Width : Integer

This property is only used internally to store a columns width while it is hidden, to obtain and change a columns width, use TStringGrids ColWidths property.


Cols : TStrings - obsolete
Rows :

These are both the same, although the former was misnamed, and will be removed in a future version. This property is used to store a columns contents while it is hidden.


Visible : Boolean

Setting this property shows or hides the corresponding column.


HeadingIndex : Integer

The Heading that corresponds to this column, if none set it to -1.


ReadOnly : Boolean

Whether the column is read only.


MaxTextLength : Integer

The longest string that can be typed in an editable cell.


ColumnHAlignment : TAlignment

The horizontal alignment of text in scrolling cells.


ColumnVAlignment : ThgVAlignment

ThgVAlignment = ( hgvaTop , hgvaCenter , hgvaBottom )

The vertical alignment of text in scrolling cells.


ColumnColor : TColor

The background color of scrolling cells.


ColumnFont : TFont

The font used for scrolling cells.


ColumnParentFont : Boolean

When set to True, the scrolling cells will use the grids font.


ColumnClipStyle : ThgClipStyle

ThgClipStyle = ( hgclpClip , hgclpEllipsis , hgclpWrap )

The clip style used when the text in a cell does not fit the dimensions of the cell

hgclpClip cuts the text off
hgclpEllipsis adds and ellipsis when the text does not fit in the cell and
hgcplWrap wraps the text into multiple lines


ColumnInnerBevel : TPanelBevel
ColumnOuterBevel : TPanelBevel

Bevels used for the scrolling cells, same as TPanel bevels.


ControlType : ThgControlTypes

ThgControlType = ( hgctlComboBox , hgctlButton )
ThgControlTypes = set of ThgControlType

This defines what kind of control(s) are displayed in the cell, when it is editable.   Note that controls will not be visible unless goEditing is set to True in the Options.

If hgctlComboBox is included, the cells for this column will display a drop down list, if hgctlButton is included, and additional button will be added to the right of the combo box.

This allows you to have :

1) Simple edit control - ControlType = []
2) Editable combo box - ControlType = [ hgctlComboBox ]
3) Edit control with custom button - ControlType = [ hgctlButton ] and
4) Edit control with drop down list and custom button - ControlType = [ hgctlComboBox , hgctlButton ]


Items : TStrings

If ControlType includes hgctlComboBox, this is the list of items that will be shown in the drop down list.


AutoSuggest : Boolean

When ControlType includes hgctlComboBox, THyperGrid can suggest a string from the items property that partially matches what the user has typed, similar to an incremental search.


ComboMaxWidth : Boolean

If set to True, the drop down list will be made wide enough so that all items will be visible.


DropDownCount : Integer

The length of the drop down list for a combo box.


DropDownList : Boolean

If set to True, the user must select an item from the Items property, otherwise, he/she can type any string into the editable portion of the combo box. Similar to the Style property for TComboBox.


ButtonStyle : ThgButtonStyle

ThgButtonStyle = ( hgbstEllipsis , hgbstDropDown , hgbstCustom )

When ControlType includes hgctlButton, this property determines what is painted on the face of the button.

hgbstEllipsis will produce a button with three dots,
hgbstDropDown will produce a button with a down arrow, like the button on a combo box and
hgbstCustom will let you put a picture in the button, or leave it undecorated.


ButtonPicture : TPicture

This is a picture used for the custom button described above.


DrawButtonFace : Boolean

If set to true, the button face of the custom button is drawn to look much like a standard TButton. Optionally, by setting ButtonPicture to a valid TPicture and setting DrawButtonFace to False, only the picture will represent the button.


ButtonVAlignment : ThgVAlignment

ThgVAlignment = ( hgvaTop , hgvaCenter , hgvaBottom )

The vertical alignment of the custom button within the cell.


FormatType : ThgFormatType

ThgFormatType = ( hgfmtNone , hgfmtNumeric , hgfmtDateTime ,
hgfmtScientific )

The format string used to convert cell strings to display text.

hgfmtNone - no formatting is performed, cell text is displayed as is
hgfmtNumeric - the cell text is interpreted to be a number and formatted accordingly
hgfmtScientific - the cell text is interpreted to be a number and formatted accordingly
hgfmtDateTime - the cell text is interpreted as a date and/or time

See also OnDisplayText and OnConversionError


Decimals : Integer

If FormatType is numeric or scientific, this is the number of decimal places to show.


Prefix : string

This is an optional prefix that is shown in front of numeric types, such as "$"


ThousandsSeparator : Boolean

If set to True, windows thousands separator character is used in formatting numeric and scientific types.


NegativeParenthesis: Boolean

If True, parenthesis are used to represent negative numbers in the numeric format type.


DateFormat : Integer

This is an index used to specify which date format to use when FormatType is set to hgfmtDateTime. The possibilities are as follows:

0        m/d
1        m/d/yy
2        mm/dd/yy
3        d-mmm
4        d-mmm-yy
5        dd-mmm-yy
6        mmm-yy
7        mmmm-yy
8        mmmm d, yyyy
9        ddd mmmm d, yyyy
10      dddd mmmm d, yyyy

Note that THyperGrid recognizes the order for month, day and year in your regional settings and shuffles each portion accordingly. In actuality, ThyperGrid has 33 formats, which are the 11 combinations above, but with the month, day and year order changed. THyperGrid uses the FormatDateTime function to accomplish all date/time formatting.


TimeFormat : Integer

If FormatType is set to hgfmtDateTime, the following time formats are available:

0        h:nn
1        h:nn ampm
2        h:nn:ss
3        h:nn:ss ampm

Once again, FormatDateTime is used to accomplish all date/time formatting.