'Declaration Public Event InitializeRow As InitializeRowEventHandler
public event InitializeRowEventHandler InitializeRow
The event handler receives an argument of type InitializeRowEventArgs containing data related to this event. The following InitializeRowEventArgs properties provide information specific to this event.
Property | Description |
---|---|
ReInitialize | True if the row has already been initialized (read-only) |
Row | The row being initialized (read-only) |
The InitializeRowEventArgs.Row argument returns a reference to an UltraGridRow object that can be used to set properties of, and invoke methods on, the row being displayed. You can use this reference to access any of the returned row's properties or methods.
The InitializeRowEventArgs.ReInitialize argument can be used to determine if the row is being initialized for the first time, such as when the UltraDropDown is initially loading data, or whether it is being reinitialized, such as when the RowsCollection.Refresh method is called.
This event is generated once for each row being displayed or printed and provides an opportunity to perform actions on the row before it is rendered, such as populating an unbound cell or changing a cell's color based on its value.
The UltraGridLayout.ViewStyle and UltraGridLayout.ViewStyleBand properties of the UltraGridBase.DisplayLayout object are read-only in this event procedure.
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Private Sub UltraDropDown1_InitializeRow(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgs) Handles ultraDropDown1.InitializeRow ' InitializeRow gets fired for every row in the UltraDropDown. This is a good ' place to set per row settings. Following code sets the fore color of all ' the cells in UnitsInStock column to red if theere are no units in stock. If e.Row.Cells("UnitsInStock").Value Is DBNull.Value OrElse Convert.ToInt32(e.Row.Cells("UnitsInStock").Value) <= 0 Then e.Row.Cells("UnitsInStock").Appearance.ForeColor = Color.Red End If End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void ultraDropDown1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e) { // InitializeRow gets fired for every row in the UltraDropDown. This is a good // place to set per row settings. Following code sets the fore color of all // the cells in UnitsInStock column to red if theere are no units in stock. if ( e.Row.Cells["UnitsInStock"].Value is DBNull || Convert.ToInt32( e.Row.Cells["UnitsInStock"].Value ) <= 0 ) { e.Row.Cells["UnitsInStock"].Appearance.ForeColor = Color.Red; } }
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