When the CancelUpdate method is invoked for a row, any changes made to the cells of the active row are removed. The cells display their original values, and the row is taken out of edit mode. The row selector picture changes from the "Write" image back to the "Current" image. The DataChanged property will be set to false.
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.ultraGrid1.SetDataBinding(Me.DataSet11, "Customers") ' Change the value of UpdateMode from the default of OnRowChangeOrLostFocus to OnRowChange ' othewise the UltraGrid will update the row as soon as the button is clicked (since the ' UltraGrid would loose focus). Me.ultraGrid1.UpdateMode = UpdateMode.OnRowChange End Sub Private Sub Button138_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button138.Click ' Get the active row. Dim activeRow As UltraGridRow = Me.UltraGrid1.ActiveRow ' If the row has been modified, then revert back to the the original values ' since the row was last updated. If Not activeRow Is Nothing AndAlso activeRow.DataChanged Then activeRow.CancelUpdate() End If End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void Form1_Load(object sender, System.EventArgs e) { this.ultraGrid1.SetDataBinding( this.dataSet11, "Customers" ); // Change the value of UpdateMode from the default of OnRowChangeOrLostFocus to OnRowChange // othewise the UltraGrid will update the row as soon as the button is clicked (since the // UltraGrid would loose focus). this.ultraGrid1.UpdateMode = UpdateMode.OnRowChange; } private void button138_Click(object sender, System.EventArgs e) { // Get the active row. UltraGridRow activeRow = this.ultraGrid1.ActiveRow; // If the row has been modified, then revert back to the the original values // since the row was last updated. if ( null != activeRow && activeRow.DataChanged ) { activeRow.CancelUpdate( ); } }
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