'Declaration Public Event AfterRowInsert As RowEventHandler
public event RowEventHandler AfterRowInsert
The event handler receives an argument of type RowEventArgs containing data related to this event. The following RowEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Row | The row (usually the row that the cell belongs to) (read-only) |
Therowargument returns a reference to an UltraGridRow object that can be used to set properties of, and invoke methods on, the row that was inserted. You can use this reference to access any of the returned row's properties or methods.
This event is generated after a new row has been inserted, either programmatically, or by user interaction. A new row can be inserted programmatically by invoking theAddNewmethod.
Note that the new row is not necessarily committed to the data source at the time of insert, however, since various factors such as the type of record locking employed by the data source, as well as the value of theUpdateModeproperty, can affect when the actual update occurs.
TheBeforeRowInsertevent, which occurs before a row is inserted, is generated before this event.
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Private Sub UltraGrid1_AfterRowInsert(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.RowEventArgs) Handles ultraGrid1.AfterRowInsert ' If the row was added to the 3rd band If e.Row.Band Is Me.ultraGrid1.DisplayLayout.Bands(2) Then ' Set a default value for OrderDate column to today's date. e.Row.Cells("OrderDate").Value = DateTime.Now End If End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void ultraGrid1_AfterRowInsert(object sender, Infragistics.Win.UltraWinGrid.RowEventArgs e) { // If the row was added to the 3rd band if ( e.Row.Band == this.ultraGrid1.DisplayLayout.Bands[2] ) { // Set a default value for OrderDate column to today's date. e.Row.Cells["OrderDate"].Value = DateTime.Now; } }
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