Jump to content

Is it possible to change text in a cell of TUniDBGrid


Tokay

Recommended Posts

I try to format text in the cells, but Attribs.AsString is read-only property. Could I change text which will be displayed in a cell in some way? Thank you.

procedure TUniForm2.UniDBGrid1DrawColumnCell(Sender: TObject; ACol, ARow: integer;
 Column: TUniDBGridColumn; Attribs: TUniCellAttribs);
begin
 if ACol > 0 then
  Attribs.AsString := FormatTriad(Column.Field.AsString);
end;

Link to comment
Share on other sites

I got it! Thank you very much.

 

I do it in that way:

 

After sql query, i add OnGetText handers to needed fields:

 IBQuery1.Fields[i].OnGetText := IBQuery1YGetText

And in the handler:

Text := FormatFileSize(Sender.AsLargeInt);

All works great! Thank you.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...