How to edit Calculated Field value in C++ Builder XE

656 Views Asked by At

I have a TDBGrid which shows some calculated fields. I'm use MySQL database.

I need to edit field values of one calculated field called "Date" but I can't. I try to edit other field called "Description" which have StringField type and it worked!

Date is shows modificated DateTime type value which only displays the Day only using DayOfTheMonth method.

How to do this? Is there any methods to edit values of Calculated Field? Help me please...

Thanks in advance.

2

There are 2 best solutions below

4
On

You can change the way you calculate the value in OnCalcField(). I think that if you refresh the current record this method gets called again so you can modify it.

0
On

A calculated field is, well, a calculated value. You can't edit a calculated field because it is a read-only value that is the result of performing calculations on other data. You have to instead edit the source fields that the calculated field is using.