Topic: Formatting a calculated field
Can I format a calculated field. It must be Currency with two decimals
My Visual Database → Script → Formatting a calculated field
Can I format a calculated field. It must be Currency with two decimals
Yes, you can using script, example for first column:
procedure Form1_TableGrid1_OnChange (Sender: TObject);
begin
if Form1.TableGrid1.Columns[0] is TNxNumberColumn then
begin
TNxNumberColumn(Form1.TableGrid1.Columns[0]).FormatMask := '#,##0.00';
TNxNumberColumn(Form1.TableGrid1.Columns[0]).Footer.FormatMask := '#,##0.00';
end;
end;
It seems not to work for me. Can you please help me?
Hi Kees,
Attached is the way that I've always formatted columns (and footers and headers). I'm sure it's not the only way but it's always worked for me (so it's what I stick with!).
A couple of things to mention;
1. in the tablegrid, columns start at 0 rather than 1 so vergoeding is actually column3 in your example.
2. you hadn't actually associated the tablegrid1 'onchange' event with the code in the script.
And apologies but I don't have a 'euro' symbol on my keyboard so you'll have to make do with £ - LOL! (just replace £ in the tablegrid properties( footer settings) and in the script).
Anything not clear, then just drop a message.
Regards,
Derek.
It seems not to work for me. Can you please help me?
Check it out
My Visual Database → Script → Formatting a calculated field
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi