TDBGrid
reads the data currently contained in its assigned dataset. It has no capacity to remember prior values, perform calculations, or anything else. If you want to track changes, you have to do it yourself. You can do it by multiple means (a prior value column, a history table, or whatever), but it can't be done by the grid itself. TDBGrid
is for presenting data, not analyzing or storing it.
One suggestion would be to track it in the dataset using the BeforePost
event, where you can store the _oldvalue
of a your into a LastValue
column, and then use that to see if the value has changed in your TDBGrid.OnDrawColumnCell
event and alter the drawing/coloring as needed. Something like if LastValue <> CurrValue then...
should work.