Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
515
EnsureCalculated
posted

Hi,

I'm hoping that someone here can give me a sample of the usage of EnsureCalculated. I have a UltraGrid with numerous formulas and qute a few custom summaries. The problem I'm having is that the summaries are throwing exceptions because the values that they are meant to summarize have not been calculated in time. Currently, the CalcManager is set to Asynchronous. If I set it to Synchronous everything works fine, so it's obvious what the problem is. I could keep toggling the CalcFrequency property in code but that seems a bit silly.

Infragistics documentation states:

"By default, calculations are done Asynchronously on a timer. This ensures that the UI thread is not locked up when long or complex calculations are performed. The disadvantage to this mode is that a particular value may not be calculated when it is requested in code. When retrieving a calculated value using Asynchronous mode, you should call the EnsureCalculated method to ensure the value has been calculated."

There's very little discussion of EnsureCalculated in the documentation but what there is makes reference to a parameter of type IUltraCalcReference. My question is this: In the AggregateCustomSummary Method of a custom summary (derived from ICustomSummaryCalculator) how can i derive the IUltraCalcReference of the row being passed in as an argument so that I might use EnsureCalculated to make certain that the appropriate cells have been calculated?

any help would certainly be appreciated

Steve