TwwDBGrid change displayed text

Comments

2 comments

  • Roy Woll

    One way to handle this is to use the Tfield.onGetText event.  This event allows you to change what is displayed for the field in the grid.  To access the tfield do the following.

    1. Dvl-Click your Dataset to bring up the fields editor, and add all the fields if you have not already done so.

    2. Select the tfield you want to change the display text for and then put code in the OnGetText event.

    3. Put code in the event to assign your text. For instance...

    procedure TFPDataModule.CustomerDataMemBuyerGetText(Sender: TField; 

      var Text: string; DisplayText: Boolean);

    begin

      if DisplayText then Text:= Sender.AsString + ' More text';

    end;
    0
    Comment actions Permalink
  • Jack Mason

    Thanks, Roy.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk