'Declaration Public Event BeforeRowCancelUpdate As CancelableRowEventHandler
public event CancelableRowEventHandler BeforeRowCancelUpdate
The event handler receives an argument of type CancelableRowEventArgs containing data related to this event. The following CancelableRowEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Cancel (Inherited from System.ComponentModel.CancelEventArgs) | |
Row | The row that the cell belongs to (read-only) |
The row argument returns a reference to an UltraGridRow object that can be used to set properties of, and invoke methods on, the row whose update will be canceled. You can use this reference to access any of the returned row's properties or methods.
The cancel argument enables you to programmatically prevent the row's update from being canceled. This argument can be used to prevent the user from canceling an update unless a certain condition is met.
This event is generated when the user presses the ESC key to cancel changes made to cells in a row. It is also generated when the CancelUpdate method is invoked.
The AfterRowCancelUpdate event, which occurs after a row's update has been canceled, is generated after this event, provided cancel is not set to True.
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Imports System.Diagnostics Private Sub UltraGrid1_BeforeRowCancelUpdate(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CancelableRowEventArgs) Handles ultraGrid1.BeforeRowCancelUpdate ' When the user modifies cells in a row and then hits Escape twice, the ' changes in the row get canceled and this event gets fired. Dim result As DialogResult = MessageBox.Show( _ "Are you sure you want to cancel changed you've made in the row ?", _ "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If DialogResult.No = result Then e.Cancel = True Else Debug.WriteLine("Changes in row with index of " & e.Row.Index.ToString() & " has been discarded since last updated.") End If End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void ultraGrid1_BeforeRowCancelUpdate(object sender, Infragistics.Win.UltraWinGrid.CancelableRowEventArgs e) { // When the user modifies cells in a row and then hits Escape twice, the // changes in the row get canceled and this event gets fired. DialogResult result = MessageBox.Show( "Are you sure you want to cancel changed you've made in the row ?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question ); if ( DialogResult.No == result ) { e.Cancel = true; } else { Debug.WriteLine( "Changes in row with index of " + e.Row.Index.ToString( ) + " has been discarded since last updated." ); } }
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