Unit 'DBGrids' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#lcl]

TCustomDBGrid.GetTruncCellHintText

Gets the truncated hint text for the specified cell.

Declaration

Source position: dbgrids.pas line 478

protected function TCustomDBGrid.GetTruncCellHintText(

  aCol: Integer;

  aRow: Integer

):string; override;

Arguments

aCol

  

Column number for the cell hint text.

aRow

  

Row number for the cell hint text.

Function result

Contains the hint text for the cell derived in the method.

Description

GetTruncCellHintText is an overridden method in TCustomDBGrid. It re-implements the method from the ancestor class, and does not call the inherited method.

GetTruncCellHintText is used to get the truncated hint text (shortened with an Ellipsis appended) for the cell specified in the ACol and ARow arguments. No actions are performed in the method if ARow is one of the FixedRows for the grid control; the return value is an empty string ('') in this situation.

GetTruncCellHintText calls GetFieldFromGridColumn to get the TField instance which provides the data for the column in ACol. The DataType for the TField instance determines the content stored in the return value. For example:

ftMemo
Uses the field value in the cell hint text when dgDisplayMemoText has been included in the Options property.
ftBlob
Causes the value '(blob)' to be used in the cell hint text.

Other values in DataType cause the DisplayText for the field to be be used as the cell hint text.

The cell hint text is an empty string ('') if a field type was not found for the specified column number, or field data for the cell contains an unassigned or NULL value (TField.IsNull returns True). This is also the cell hint returned when the dataset for the grid is empty.

The OnGetCellHint event handler is signalled (when assigned) if CellHintPriority is set to chpTruncOnly. This allows the TColumn instance for the cell to be used to override the value for the cell hint text or to truncate the value to a specific length.

GetTruncCellHintText is called from the ShowCellHintWindow method in the ancestor class.

See also

TCustomDBGrid.GetFieldFromGridColumn

  

GetFieldFromGridColumn obtain the Field either from a Db column or directly from dataset Fields.

TCustomDBGrid.CheckDisplayMemo

  

Indicates if the field is a Memo that needs to be displayed in the grid.

TCustomDBGrid.OnGetCellHint

  

Event handler signalled to get the hint text for a cell in the grid control.

TCustomGrid.FixedRows

  

Number of the fixed rows in the grid.

TCustomGrid.ColumnFromGridColumn

  

Returns the grid column definition at the specified position in Columns.

TCustomGrid.CellHintPriority

  

Identifies how text is combined to form the Hint property.

TCustomGrid.CellHintPriority

  

Represents the cell hint display priorities.

TField.DataType

TField.DisplayText


Version 4.6 Generated 2026-02-20 Home