Version

ReCalc(Int64) Method

Forces recalculation of all dirtied items in the Calculation Network.
Syntax
'Declaration
 
Public Overloads Function ReCalc( _
   ByVal millis As Long _
) As Boolean
public bool ReCalc( 
   long millis
)

Parameters

millis
Number of milliseconds to allow for calculations before control returns to the caller (to wait indefinitely, specify -1.)

Return Value

Returns a boolean indicating if anything in the calculation network remains dirty.
Exceptions
ExceptionDescription
System.ArgumentOutOfRangeExceptionThrown when the value supplied for millis is either less than -1, or too great to convert into a number of clock ticks. The precise upper bound of millis may vary depending upon the granularity of the machine's hardware clock, but it exceeds any amount of time which would be a sensible argument (instead, use -1 to indicate an indefinite wait).
Remarks

Developers can use this method to limit the amount of time in the time slice _CALCMANAGER_ spends performing it's calculations. If all calculations have been completed before this time interval elapses, control returns immediately to the caller. Setting this interval too small can lead to excessive task-switching that would make the calculation complete more slowly than it ordinarily would have completed, therefore developers are advised to allot as much time as the user-responsiveness of the application permits.

Example
UltraCalcManager by default does calculations asynchronously using a timer. You can use ReCalc method to force UltraCalcManager to perform calculations.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports Infragistics.Win.CalcEngine
Imports Infragistics.Win.UltraWinCalcManager


    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
        Me.UltraCalcManager1.NamedReferences.Clear()

        Me.UltraCalcManager1.NamedReferences.Add("N1", "5")
        Me.ultraCalcManager1.NamedReferences.Add("N2", "2 * [N1]")

        Dim result As UltraCalcValue
        result = Me.UltraCalcManager1.NamedReferences("N2").FormulaResult
        System.Diagnostics.Debug.WriteLine("Result before calling Recalc: " & result.ToString())

        Me.UltraCalcManager1.ReCalc(-1)

        result = Me.UltraCalcManager1.NamedReferences("N2").FormulaResult
        System.Diagnostics.Debug.WriteLine("Result after calling Recalc: " & result.ToString())
    End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;
using Infragistics.Win.CalcEngine;
using Infragistics.Win.UltraWinCalcManager;


		private void button1_Click(object sender, System.EventArgs e)
		{
			this.ultraCalcManager1.NamedReferences.Clear( );

			this.ultraCalcManager1.NamedReferences.Add( "N1", "5" );
			this.ultraCalcManager1.NamedReferences.Add( "N2", "2 * [N1]" );

			UltraCalcValue result;			
			result = this.ultraCalcManager1.NamedReferences["N2"].FormulaResult;
			System.Diagnostics.Debug.WriteLine( "Result before calling Recalc: " + result.ToString( ) );

			this.ultraCalcManager1.ReCalc( -1 );

			result = this.ultraCalcManager1.NamedReferences["N2"].FormulaResult;
			System.Diagnostics.Debug.WriteLine( "Result after calling Recalc: " + result.ToString( ) );
		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also