Version

FormulaCalculationError Event

Fired any time the attempt to calculate a formula results in an error.
Syntax
'Declaration
 
Public Event FormulaCalculationError As FormulaCalculationErrorEventHandler
public event FormulaCalculationErrorEventHandler FormulaCalculationError
Event Data

The event handler receives an argument of type Infragistics.Win.CalcEngine.FormulaCalculationErrorEventArgs containing data related to this event. The following FormulaCalculationErrorEventArgs properties provide information specific to this event.

PropertyDescription
Context (Inherited from Infragistics.Win.CalcEngine.FormulaErrorEventArgsBase) 
ErrorDisplayIcon  
ErrorDisplayText (Inherited from Infragistics.Win.CalcEngine.FormulaErrorEventArgsBase) 
ErrorInfo  
ErrorValue  
Remarks

FormulaCalculationError event is fired any time the attempt to calcuate a formula results in an error, whether it be a reference, syntax, or mathematical error..

Example
Imports Infragistics.CalcEngine
Imports Infragistics.Win.UltraWinCalcManager

Private Sub UltraCalcManager1_FormulaCalculationError(ByVal sender As Object, ByVal e As Infragistics.CalcEngine.FormulaCalculationErrorEventArgs) Handles UltraCalcManager1.FormulaCalculationError
        Select Case e.ErrorInfo.Code
            Case UltraCalcErrorCode.Div
                'e.ErrorDisplayIcon = errorIconDivideByZero
                e.ErrorDisplayText = "Divide by Zero Error"
                e.ErrorValue = "#Div"
            Case UltraCalcErrorCode.NA
                'e.ErrorDisplayIcon = errorIconNA
                e.ErrorDisplayText = "A formula of NA was encountered"
                e.ErrorValue = "#NA"
            Case UltraCalcErrorCode.Num
                'e.ErrorDisplayIcon = errorIconInvalidNumericValue
                e.ErrorDisplayText = "Invalid numeric values encountered"
                e.ErrorValue = "#Num"
            Case UltraCalcErrorCode.Value
                'e.ErrorDisplayIcon = errorIconInvalidArgument
                e.ErrorDisplayText = "Invalid argument type encountered"
                e.ErrorValue = "#Value"
        End Select
    End Sub
using Infragistics.CalcEngine;
using Infragistics.Win.UltraWinCalcManager;

private void ultraCalcManager1_FormulaCalculationError(object sender, Infragistics.CalcEngine.FormulaCalculationErrorEventArgs e)
		{
			switch ( e.ErrorInfo.Code )
			{
				case UltraCalcErrorCode.Div:
					//e.ErrorDisplayIcon = errorIconDivideByZero;
                    e.ErrorDisplayText = "Divide by Zero Error";	
					e.ErrorValue = "#Div";
					break;
				case UltraCalcErrorCode.NA:
					//e.ErrorDisplayIcon = errorIconNA;
					e.ErrorDisplayText = "A formula of NA was encountered";
					e.ErrorValue = "#NA";
					break;
				case UltraCalcErrorCode.Num:
					//e.ErrorDisplayIcon = errorIconInvalidNumericValue;
					e.ErrorDisplayText = "Invalid numeric values encountered";
					e.ErrorValue = "#Num";
					break;
				case UltraCalcErrorCode.Value:
					//e.ErrorDisplayIcon = errorIconInvalidArgument;
					e.ErrorDisplayText = "Invalid argument type encountered";
					e.ErrorValue = "#Value";
					break;
			}
		}
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