Contents - Index - Previous - Next


OnDisplayText event



Applies to
TProfGrid component

Declaration
property OnDisplayText: TProfGridDisplayTextEvent;

Description

Occurs when the text of a grid cell is displayed on the screen.

The event is basically intended for finding out whether the text of a particular cell is displayed in its entirety or has been truncated and is displayed with ellipses at the end of the display string.


Example

The following event handler shows a hint for a cell only if there is not enough space to show the entire text of the cell.

procedure TForm1.ProfGrid1DisplayText(Sender: TProfGrid;
  Cell: TProfGridCell; const DisplayText: WideString);
begin
  if Cell.Text <> DisplayText then
    Cell.Hint := Cell.Text
  else
    Cell.Hint := ''
end;