Discussion:
How to force recalculation of calcFields in TClientDataset
(too old to reply)
Aivar Annamaa
2005-12-27 12:54:49 UTC
Permalink
... at any time, even when nothing has changed in this dataset?

thanks!

Aivar
Bill Todd
2005-12-27 12:57:41 UTC
Permalink
Post by Aivar Annamaa
... at any time, even when nothing has changed in this dataset?
thanks!
Aivar
Close and reopen the CDS. Since it makes no sense to recalculate the
value of calculated fields when you know you will get the same values
that you currently have you might consider telling us what you are
really trying to do.
--
Bill Todd (TeamB)
Aivar Annamaa
2005-12-27 15:34:09 UTC
Permalink
Post by Bill Todd
that you currently have you might consider telling us what you are
really trying to do.
Post by Aivar Annamaa
... at any time, even when nothing has changed in this dataset?
actually, I wanted to say that "when no field with FieldKind=fkData has
changed"

The computed fields would be different because they use in computation
some other info outside the dataset.

To be more specific, I use grid where multiple rows can be selected (or
marked). I wish I could have the info about this selection in a computed
boolean field (and during computation I would use Grid's BookmarkList).
Then I could filter the dataset using this boolean field. But I need to
recompute the field when user alters the selection.


Aivar
Bill Todd
2005-12-27 15:39:43 UTC
Permalink
Post by Aivar Annamaa
The computed fields would be different because they use in
computation some other info outside the dataset.
Calculated fields were not designed to work with data external to the
dataset.
Post by Aivar Annamaa
To be more specific, I use grid where multiple rows can be selected
(or marked). I wish I could have the info about this selection in a
computed boolean field (and during computation I would use Grid's
BookmarkList). Then I could filter the dataset using this boolean
field. But I need to recompute the field when user alters the
selection.
I cannot think of any way to do that. Sorry.
--
Bill Todd (TeamB)
Ed Blanchard
2005-12-27 18:06:13 UTC
Permalink
In article <***@newsgroups.borland.com>, ***@reg.agri.ee
says...
Post by Aivar Annamaa
actually, I wanted to say that "when no field with FieldKind=fkData has
changed"
The computed fields would be different because they use in computation
some other info outside the dataset.
To be more specific, I use grid where multiple rows can be selected (or
marked). I wish I could have the info about this selection in a computed
boolean field (and during computation I would use Grid's BookmarkList).
Then I could filter the dataset using this boolean field. But I need to
recompute the field when user alters the selection.
Change the field type from calculated to InternalCalc. I do similar
things all the time - I'll add a boolean InternalCalc field called
"Marked" to the dataset, then modify it's content in code based on a
variety of events in grids, related data, etc. I find it more reliable
to maintain than bookmarks - if the user filters a view, I still have
the "marked" fields set.

EdB
Aivar Annamaa
2005-12-28 06:18:27 UTC
Permalink
Post by Ed Blanchard
Change the field type from calculated to InternalCalc. I do similar
things all the time - I'll add a boolean InternalCalc field called
"Marked" to the dataset, then modify it's content in code based on a
variety of events in grids, related data, etc. I find it more reliable
to maintain than bookmarks - if the user filters a view, I still have
the "marked" fields set.
EdB
Thanks, this solution seems fine.
Aivar Annamaa
2005-12-29 09:14:30 UTC
Permalink
Post by Ed Blanchard
Change the field type from calculated to InternalCalc. I do similar
things all the time - I'll add a boolean InternalCalc field called
"Marked" to the dataset, then modify it's content in code based on a
variety of events in grids, related data, etc. I find it more reliable
to maintain than bookmarks - if the user filters a view, I still have
the "marked" fields set.
Is it ok to edit interal calc field anytime when fkData fields can be
edited?
Documentation only mentions calculating internal calc fields in
OnCalcFields event handler.

Aivar

Loading...