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; } }