Version

NamedReferenceResultChanged Event

Fired after a NamedReference value has changed.
Syntax
'Declaration
 
Public Event NamedReferenceResultChanged As NamedReferenceResultChangedEventHandler
public event NamedReferenceResultChangedEventHandler NamedReferenceResultChanged
Event Data

The event handler receives an argument of type NamedReferenceResultChangedEventArgs containing data related to this event. The following NamedReferenceResultChangedEventArgs properties provide information specific to this event.

PropertyDescription
NamedReference Gets the NamedReference whose Value was changed.
Remarks

This event fires any time the result of a NamedReference changes.

Example
Following code demonstrates how named references can be used.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

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()

        ' Add two named references named N1 and N2. N2 multiplies the value of
        ' N1 by 2.
        Me.UltraCalcManager1.NamedReferences.Add("N1", "5")
        Me.ultraCalcManager1.NamedReferences.Add("N2", "2 * [N1]")
    End Sub


    Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        ' Change the value of N1 from 5 to 20. This will cause the N2 to get 
        ' recalculated and NamedReferenceResultChanged will be raised.
        Me.UltraCalcManager1.NamedReferences("N1").Formula = "20"
    End Sub

    Private Sub UltraCalcManager1_NamedReferenceResultChanged(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinCalcManager.NamedReferenceResultChangedEventArgs) Handles ultraCalcManager1.NamedReferenceResultChanged
        System.Diagnostics.Debug.WriteLine(e.NamedReference.Key _
            & " named reference got calculated. It's TypeOf value is " _
            & e.NamedReference.FormulaResult.ToDouble())
    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( );

			// Add two named references named N1 and N2. N2 multiplies the value of
			// N1 by 2.
			this.ultraCalcManager1.NamedReferences.Add( "N1", "5" );
			this.ultraCalcManager1.NamedReferences.Add( "N2", "2 * [N1]" );
		}

		
		private void button2_Click(object sender, System.EventArgs e)
		{
			// Change the value of N1 from 5 to 20. This will cause the N2 to get 
			// recalculated and NamedReferenceResultChanged will be raised.
			this.ultraCalcManager1.NamedReferences["N1"].Formula = "20";
		}

		private void ultraCalcManager1_NamedReferenceResultChanged(object sender, Infragistics.Win.UltraWinCalcManager.NamedReferenceResultChangedEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine( e.NamedReference.Key 
				+ " named reference got calculated. It's value is " 
				+ e.NamedReference.FormulaResult.ToDouble() );
		}
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