Version

BeforeDataNodesCollectionPopulated Event

Occurs when a TreeNodesCollection object is created and is about to be populated with bound data.
Syntax
'Declaration
 
Public Event BeforeDataNodesCollectionPopulated As BeforeDataNodesCollectionPopulatedEventHandler
public event BeforeDataNodesCollectionPopulatedEventHandler BeforeDataNodesCollectionPopulated
Event Data

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

PropertyDescription
IsPrinting (Inherited from Infragistics.Win.UltraWinTree.DataNodesCollectionPopulatedEventArgs)Returns true if the nodes collection being populated is in a tree that is being used by an UltraTreePrintDocument for printing.
Nodes (Inherited from Infragistics.Win.UltraWinTree.DataNodesCollectionPopulatedEventArgs)Returns the TreeNodesCollection instance which is being initialized from the data source.
Example
The following code sample demonstrates how to use the BeforeDataNodesCollectionPopulated and AfterDataNodesCollectionPopulated to receive a natification before and after a nodes collection is populated from a data source.

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.Win
Imports Infragistics.Win.Layout
Imports Infragistics.Win.UltraWinTree

    Private Sub ultraTree1_BeforeDataNodesCollectionPopulated(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTree.BeforeDataNodesCollectionPopulatedEventArgs) Handles ultraTree1.BeforeDataNodesCollectionPopulated

        If Not e.Nodes.ParentNode Is Nothing Then
            Debug.WriteLine("Populating nodes collection for '" + e.Nodes.ParentNode.Text + "'...")
        Else
            Debug.WriteLine("Populating root nodes collection...")
        End If

    End Sub

    Private Sub ultraTree1_AfterDataNodesCollectionPopulated(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTree.AfterDataNodesCollectionPopulatedEventArgs) Handles ultraTree1.AfterDataNodesCollectionPopulated

        If Not e.Nodes.ParentNode Is Nothing Then
            Debug.WriteLine("Nodes collection for '" + e.Nodes.ParentNode.Text + "' populated.")
        Else
            Debug.WriteLine("Root nodes collection populated.")
        End If

    End Sub
using Infragistics.Win;
using Infragistics.Win.Layout;
using Infragistics.Win.UltraWinTree;
using System.Diagnostics;

		private void ultraTree1_BeforeDataNodesCollectionPopulated(object sender, Infragistics.Win.UltraWinTree.BeforeDataNodesCollectionPopulatedEventArgs e)
		{
			if ( e.Nodes.ParentNode != null )
				Debug.WriteLine( "Populating nodes collection for '" + e.Nodes.ParentNode.Text + "'..." );
			else
				Debug.WriteLine( "Populating root nodes collection..." );
		}

		private void ultraTree1_AfterDataNodesCollectionPopulated(object sender, Infragistics.Win.UltraWinTree.AfterDataNodesCollectionPopulatedEventArgs e)
		{
			if ( e.Nodes.ParentNode != null )
				Debug.WriteLine( "Nodes collection for '" + e.Nodes.ParentNode.Text + "' populated." );
			else
				Debug.WriteLine( "Root nodes collection populated." );
		}
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