Version

InitializeRowsCollection Event

InitializeRowsCollection event is fired whenever UltraGrid creates a new row collection.
Syntax
'Declaration
 
Public Event InitializeRowsCollection As InitializeRowsCollectionEventHandler
public event InitializeRowsCollectionEventHandler InitializeRowsCollection
Event Data

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

PropertyDescription
Rows Gets the row collection that was created.
Example
The following code writes out some information about the row collection being initialized in the InitializeRowsCollection event handler.

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


    Private Sub UltraGrid1_InitializeRowsCollection(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeRowsCollectionEventArgs) Handles UltraGrid1.InitializeRowsCollection
        Dim rows As RowsCollection = e.Rows

        Dim count As Integer = rows.Count
        Dim band As UltraGridBand = rows.Band
        Dim parentRow As UltraGridRow = rows.ParentRow

        Dim parentRowId As String
        If Not Nothing Is parentRow Then
            parentRowId = parentRow.Cells(0).Text
        Else
            parentRowId = "{NULL}"
        End If

        System.Diagnostics.Debug.WriteLine(String.Format( _
                "InitializeRowsCollection: count = {0} band = {1}, parent row = {2}", _
                count, band.Key, parentRowId))
    End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;


		private void UltraGrid1_InitializeRowsCollection(object sender, Infragistics.Win.UltraWinGrid.InitializeRowsCollectionEventArgs e)
		{
			RowsCollection rows = e.Rows;

			int count = rows.Count;
			UltraGridBand band = rows.Band;
			UltraGridRow parentRow = rows.ParentRow;

			string parentRowId;
			if ( null != parentRow )
			{
				parentRowId = parentRow.Cells[0].Text;
			}
			else
			{
				parentRowId = "{NULL}";
			}
            
			System.Diagnostics.Debug.WriteLine( string.Format( 
					"InitializeRowsCollection: count = {0} band = {1}, parent row = {2}", 
					count, band.Key, parentRowId ) );
		}
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