バージョン

FormulaReferenceError イベント

数式の中で参照しているオブジェクトが計算時に見つからないときに発生します。
シンタックス
'宣言
 
Public Event FormulaReferenceError As FormulaCalculationErrorEventHandler
public event FormulaCalculationErrorEventHandler FormulaReferenceError
イベント データ

イベント ハンドラが、このイベントに関連するデータを含む、Infragistics.Win.CalcEngine.FormulaCalculationErrorEventArgs 型の引数を受け取りました。次の FormulaCalculationErrorEventArgs プロパティには、このイベントの固有の情報が記載されます。

プロパティ解説
Context Infragistics.Win.CalcEngine.FormulaErrorEventArgsBaseから継承されます。 
ErrorDisplayIcon  
ErrorDisplayText Infragistics.Win.CalcEngine.FormulaErrorEventArgsBaseから継承されます。 
ErrorInfo  
ErrorValue  
解説

このイベントは、UltraCalcManager が計算ネットワークにない参照を参照する数式を計算しようと試みるたびに発生します。

使用例
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()
        ' Here the formula references N2 which does not exist. This will cause the
        ' FormulaReferenceError to be raised.
        Me.ultraCalcManager1.NamedReferences.Add("N1", "2 * [N2]")
    End Sub

    Private Sub UltraCalcManager1_FormulaReferenceError(ByVal sender As Object, ByVal e As Infragistics.Win.CalcEngine.FormulaCalculationErrorEventArgs) Handles ultraCalcManager1.FormulaReferenceError
        ' Context is the object associated with the formula that has the circularity.
        ' It could an instance of NamedReference, CalcSettings or a grid object like
        ' UltraGridColumn or SummarySettings.
        If TypeOf e.Context Is NamedReference Then
            Dim nr As NamedReference = DirectCast(e.Context, NamedReference)
            MessageBox.Show(Me, nr.Formula & " formula has a reference error.")
        End If

        ' If the formula with the reference error was on a control on the form then
        ' this error icon will be displayed with the control. Note that this does not
        ' apply to UltraGrid column and summary formulas.
        'e.ErrorDisplayIcon = new Icon( "erroricon.ico" );

        ' You can set the text of the tool tip that will displayed when the user hovers
        ' the mouse over the error icon beside the control associated with the formula.
        e.ErrorDisplayText = "Formula refers to something non existant."
    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( );
			// Here the formula references N2 which does not exist. This will cause the
			// FormulaReferenceError to be raised.
			this.ultraCalcManager1.NamedReferences.Add( "N1", "2 * [N2]" );
		}

		private void ultraCalcManager1_FormulaReferenceError(object sender, Infragistics.Win.CalcEngine.FormulaCalculationErrorEventArgs e)
		{
			// Context is the object associated with the formula that has the circularity.
			// It could an instance of NamedReference, CalcSettings or a grid object like
			// UltraGridColumn or SummarySettings.
			if ( e.Context is NamedReference )
			{
				NamedReference nr = (NamedReference)e.Context;
				MessageBox.Show( this, nr.Formula + " formula has a reference error." );
			}

			// If the formula with the reference error was on a control on the form then
			// this error icon will be displayed with the control. Note that this does not
			// apply to UltraGrid column and summary formulas.
			//e.ErrorDisplayIcon = new Icon( "erroricon.ico" );
			
			// You can set the text of the tool tip that will displayed when the user hovers
			// the mouse over the error icon beside the control associated with the formula.
			e.ErrorDisplayText = "Formula refers to something non existant.";
		}
参照