Version

RowCancelEdit Event

RowCancelEdit event is fired when CancelEdit on the System.ComponentModel.IEditableObject implementation of the UltraDataRow is called.
Syntax
'Declaration
 
Public Event RowCancelEdit As RowCancelEditEventHandler
public event RowCancelEditEventHandler RowCancelEdit
Event Data

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

PropertyDescription
Row (Inherited from Infragistics.Win.UltraWinDataSource.UltraDataRowEventArgs)Gets the row.
Remarks

RowCancelEdit event is fired when CancelEdit on the System.ComponentModel.IEditableObject implementation of the UltraDataRow is called. Typically bound controls call CancelEdit on a row to discard series of modifications that might have been made to a row and restore the original values. RowBeginEdit, RowEndEdit and RowCancelEdit events correspond to UltraDataRow implementation of System.ComponentModel.IEditableObject.BeginEdit, System.ComponentModel.IEditableObject.EndEdit and System.ComponentModel.IEditableObject.CancelEdit.

NOTE: multiple rows can be in edit mode at the same time. As a result RowBeginEdit and RowCancelEdit or RowEndEdit can fire asynchronously for different rows.

Example
Following code simply prints out row index in RowBeginEdit, RowCancelEdit and RowEndEdit events.

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.UltraWinDataSource


    Private Sub UltraDataSource1_RowBeginEdit(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinDataSource.RowBeginEditEventArgs) Handles ultraDataSource1.RowBeginEdit
        ' RowBeginEdit gets fired whenever a bound control starts a row edit 
        ' operation. If you are instructing UltraDataSource to not cache data
        ' in CellDataRequested/CellDataUpdated events then you would have to
        ' backup the row data so that in RowCancelEdit you can revert the row
        ' data back to the backed up data in case the user cancels the row
        ' modifications.
        Debug.WriteLine("RowBeginEdit fired on row with index " & e.Row.Index)
    End Sub

    Private Sub UltraDataSource1_RowCancelEdit(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinDataSource.RowCancelEditEventArgs) Handles ultraDataSource1.RowCancelEdit
        ' RowCancelEdit gets called whenever a bound control cancels row 
        ' modifications. If you are instructing UltraDataSource to not cache 
        ' data in CellDataRequested/CellDataUpdated events then you would 
        ' have to backup the row data in RowBeginEdit so that in this event
        ' you can revert the row data back to the backed up data in case the 
        ' user cancels the row modifications.
        Debug.WriteLine("RowCancelEdit fired on row with index " & e.Row.Index)
    End Sub

    Private Sub UltraDataSource1_RowEndEdit(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinDataSource.RowEndEditEventArgs) Handles ultraDataSource1.RowEndEdit
        ' RowEndEdit is fired when a bound control commits modifications made to a 
        ' row.
        Debug.WriteLine("RowEndEdit fired on row with index " & e.Row.Index)
    End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinDataSource;
using System.Diagnostics;


		private void ultraDataSource1_RowBeginEdit(object sender, Infragistics.Win.UltraWinDataSource.RowBeginEditEventArgs e)
		{
			// RowBeginEdit gets fired whenever a bound control starts a row edit 
			// operation. If you are instructing UltraDataSource to not cache data
			// in CellDataRequested/CellDataUpdated events then you would have to
			// backup the row data so that in RowCancelEdit you can revert the row
			// data back to the backed up data in case the user cancels the row
			// modifications.
			Debug.WriteLine( "RowBeginEdit fired on row with index " + e.Row.Index );
		}

		private void ultraDataSource1_RowCancelEdit(object sender, Infragistics.Win.UltraWinDataSource.RowCancelEditEventArgs e)
		{
			// RowCancelEdit gets called whenever a bound control cancels row 
			// modifications. If you are instructing UltraDataSource to not cache 
			// data in CellDataRequested/CellDataUpdated events then you would 
			// have to backup the row data in RowBeginEdit so that in this event
			// you can revert the row data back to the backed up data in case the 
			// user cancels the row modifications.
			Debug.WriteLine( "RowCancelEdit fired on row with index " + e.Row.Index );
		}

		private void ultraDataSource1_RowEndEdit(object sender, Infragistics.Win.UltraWinDataSource.RowEndEditEventArgs e)
		{
			// RowEndEdit is fired when a bound control commits modifications made to a 
			// row.
			Debug.WriteLine( "RowEndEdit fired on row with index " + e.Row.Index );
		}
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