バージョン

CancelUpdate メソッド (UltraGridRow)

データが変更されたときの行またはセルの更新をキャンセルします([ESC]キーの押下と同様です)。
シンタックス
'宣言
 
Public Sub CancelUpdate() 
public void CancelUpdate()
解説

CancelUpdate メソッドが行に対して呼び出されると、アクティブ行のセルに行われた変更が削除されます。セルはオリジナルの値を表示し、行は編集モードから出ます。行セレクター ピクチャは、"Write" イメージから "Current" イメージに変わります。DataChanged プロパティは 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( );
	}

}
参照