バージョン

InitializeDataNode イベント

データソース内の ListObject を表す UltraTreeNode オブジェクトが作成されたときに発生します。
シンタックス
'宣言
 
Public Event InitializeDataNode As InitializeDataNodeEventHandler
public event InitializeDataNodeEventHandler InitializeDataNode
イベント データ

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

プロパティ解説
IsPrinting 生成されているノード コレクションが UltraTreePrintDocument によって印刷のために使用されるツリーにある場合は True を返します。
Node データソースから初期化される UltraTreeNode インスタンスを返します。
Reinitialize このノードが再初期化されるかどうかを示します。
使用例
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();
			}
		}
参照