TeeGrid DataFormat.Float has no effect

Hello,

I’m trying to format a currency column in TeeGrid, but the DataFormat.Float property seems to have no effect.

Environment:

  • Delphi 10.3.3 / TeeGrid 1.19
  • Database: SQL Server
  • Field Type: Money (mapped to TBCDField)
  • Column Name: ‘Amount’

Code tested:

TeeGrid1.Columns['Amount'].DataFormat.Float := '0.';
TeeGrid1.Columns['Amount'].DataFormat.Float := '0.##';
TeeGrid1.Columns['Amount'].DataFormat.Float := '0.00';
TeeGrid1.Columns['Amount'].DataFormat.Float := '#,##0.0000';

teeDataFormat.7z (51.6 KB)
None of these format strings change the display format. The column still shows the default format.

Question:
What is the correct way to format currency/money fields in TeeGrid? Should I use a different property or approach?

Thank you!

Hello,

Your approach appears correct. See the Cell Editors demo. (ie. TeeGrid-VCL-FMX-Samples/demos/VCL/Cell Editors
/Unit_Editors.pas
).

// Set some column Formatting strings
TeeGrid1.Columns['Height'].DataFormat.Float:='0.##';
TeeGrid1.Columns['BirthDate'].DataFormat.DateTime:='mm-dd-yyyy';

That appears to be working correctly in the demo, so perhaps there is a different, underlying issue.

Regards,
Marc Meumann