[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'DBGrids' (#lcl)

TCustomDBGrid.GetTruncCellHintText

Gets the truncated hint text for the specified cell.

Declaration

Source position: dbgrids.pas line 482

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 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.


Version 3.2 Generated 2024-02-25 Home