N.Marzio Posted May 10, 2021 Share Posted May 10, 2021 Can you tell me why the following formatting doesn't work? procedure TxFraBaseGrid.DBGridDrawColumnCell (Sender: TObject; ACol, ARow: Integer; Column: TUniDBGridColumn; Attribs: TUniCellAttribs); begin if Column.FieldName = 'amount1' then TFloatField (Column.Field) .DisplayFormat: = '0.00'; if Column.FieldName = 'totalline' then TFloatField (Column.Field) .DisplayFormat: = '#, ## 0.00'; end; Thank you Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted May 10, 2021 Share Posted May 10, 2021 28 minutes ago, N.Marzio said: Can you tell me why the following formatting doesn't work? procedure TxFraBaseGrid.DBGridDrawColumnCell (Sender: TObject; ACol, ARow: Integer; Column: TUniDBGridColumn; Attribs: TUniCellAttribs); begin if Column.FieldName = 'amount1' then TFloatField (Column.Field) .DisplayFormat: = '0.00'; if Column.FieldName = 'totalline' then TFloatField (Column.Field) .DisplayFormat: = '#, ## 0.00'; end; Thank you Hello, You can't change displayformat in drawcolumncell. Try change the display format OnCreate or OnBeforeshow Quote Link to comment Share on other sites More sharing options...
N.Marzio Posted May 10, 2021 Author Share Posted May 10, 2021 Insert after afterOpen of the DataSet works correctly. Thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.