Version

AfterRowUpdate Event

Occurs after a row is updated, meaning changes made to its cells are actually committed to the data source.
Syntax
'Declaration
 
Public Event AfterRowUpdate As RowEventHandler
public event RowEventHandler AfterRowUpdate
Event Data

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.

PropertyDescription
Row The row (usually the row that the cell belongs to) (read-only)
Remarks

Therowargument returns a reference to an UltraGridRow object that can be used to set properties of, and invoke methods on, the row that was updated. You can use this reference to access any of the returned row's properties or methods.

This event is generated when a row is updated, meaning changes made to its cells are actually committed to the data source. Note that this is not necessarily when the row loses focus, 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 update occurs. TheBeforeCellUpdateevent is generated when a cell is accepting a new value.

To prevent the user from making changes to a cell, set theAllowUpdateproperty to 2 (AllowUpdateNo). A cell's value can be changed programmatically by setting itsValueproperty.

A row can be updated programmatically by invoking itsUpdatemethod.

TheBeforeRowUpdateevent, which occurs before a row is updated, is generated before this event.

If an error occurs while attempting to commit the changes to the data source, theErrorevent is generated.

Example
Following code shows some of the information available in AfterRowUpdate event. It gets the underlying DataRow associated with the row that was updated and prints out its RowState property. For this to work, the UltraGrid must be bound to a DataSet.

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
Imports System.Diagnostics

   Private Sub UltraGrid1_AfterRowUpdate(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.RowEventArgs) Handles ultraGrid1.AfterRowUpdate

       ' AfterRowUpdate gets called after a row has been updated by the UltraGrid.

       If TypeOf Me.ultraGrid1.DataSource Is DataSet Then
           If e.Row.Band Is Me.ultraGrid1.DisplayLayout.Bands(0) Then
               Dim drv As DataRowView = DirectCast(e.Row.ListObject, DataRowView)
               Dim dr As DataRow = drv.Row
               Debug.WriteLine("Row state of the data row sould be modified: " & dr.RowState.ToString())
           End If
       End If

   End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void ultraGrid1_AfterRowUpdate(object sender, Infragistics.Win.UltraWinGrid.RowEventArgs e)
{

	// AfterRowUpdate gets called after a row has been updated by the UltraGrid.

	if ( this.ultraGrid1.DataSource is DataSet )
	{
		if ( e.Row.Band == this.ultraGrid1.DisplayLayout.Bands[0] )
		{
			DataRowView drv = (DataRowView)e.Row.ListObject;	

			DataRow dr = drv.Row;

			Debug.WriteLine( "Row state of the data row sould be modified: " + dr.RowState.ToString( ) );
		}
	}

}
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