Version

InitializeDataNode Event

Occurs when an UltraTreeNode object is created to represent a ListObject in a data source.
Syntax
'Declaration
 
Public Event InitializeDataNode As InitializeDataNodeEventHandler
public event InitializeDataNodeEventHandler InitializeDataNode
Event Data

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

PropertyDescription
IsPrinting Returns true if the nodes collection being populated is in a tree that is being used by an UltraTreePrintDocument for printing.
Node Returns the UltraTreeNode instance which is being initialized from the data source.
Reinitialize Indicates whether this node is being reinitialized.
Example
Imports Infragistics.Win.UltraWinTree

    Private Sub ultraTree1_InitializeDataNode(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTree.InitializeDataNodeEventArgs) Handles ultraTree1.InitializeDataNode
        ' This event fires every time a node is added to the tree from 
        ' a data source. It also fires when the data in the underlying list 
        ' object is updated and the node is refreshed. 

        ' It's a good place to apply Appearances that are dependent on
        ' the value of a cell. 

        ' The following code will highlight any Invoice over $100 
        ' by applying the "bigMoney" Appearance which was creates in earlier. 

        ' First, we need to make sure this is not a Band Node. 
        If e.Node.IsBandNode Then Return

        ' Now check to see if this is the correct band - Invoices.
        If e.Node.BandName = "Invoices" Then
            ' Get the value of the Total cell
            Dim cellValue As Decimal = 0

            If Not e.Node.Cells("Total").Value Is DBNull.Value Then
                cellValue = e.Node.Cells("Total").Value

                If (cellValue >= 100) Then
                    ' If the value is more than 100, apply the "BigMoney" appearance. 
                    e.Node.Cells("Total").Appearance = Me.ultraTree1.Appearances("BigMoney")
                Else
                    ' Otherwise, reset the Appearance of the cell. 
                    ' This is neccessary in case the underlying value of the
                    ' cell in the DataSet changes. In that case, this event 
                    ' will fire again - which gives us the opportunity to clear
                    ' the Appearance. 
                    e.Node.Cells("Total").ResetAppearance()
                End If
            End If
        End If
    End Sub
using Infragistics.Win.UltraWinTree;

		private void ultraTree1_InitializeDataNode(object sender, Infragistics.Win.UltraWinTree.InitializeDataNodeEventArgs e)
		{
			// This event fires every time a node is added to the tree from 
			// a data source. 
			// It's a good place to apply Appearances that are dependent on
			// the value of a cell. 

			// The following code will highlight any Invoice over $100 
			// by applying the "bigMoney" Appearance which was creates in earlier. 

			// First, we need to make sure this is not a Band Node. 
			if (e.Node.IsBandNode)
				return;

			// Now check to see if this is the correct band - Invoices.
			if (e.Node.BandName == "Invoices")
			{
				// Get the value of the Total cell
				decimal cellValue = 0;
				
				if (e.Node.Cells["Total"].Value != DBNull.Value)
					cellValue = (decimal)e.Node.Cells["Total"].Value;
				
				if (cellValue >= 100)					
					// If the value is more than 100, apply the "BigMoney" appearance. 
					e.Node.Cells["Total"].Appearance = this.ultraTree1.Appearances["BigMoney"];
				else
					// Otherwise, reset the Appearance of the cell. 
					// This is neccessary in case the underlying value of the
					// cell in the DataSet changes. In that case, this event 
					// will fire again - which gives us the opportunity to clear
					// the Appearance. 
					e.Node.Cells["Total"].ResetAppearance();
			}
		}
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