バージョン

DataChanged プロパティ (UltraGridRow)

セルまたは行のデータが変更されたもののデータソースにまだコミットされていないかどうかを決める値を返します。このプロパティは実行時には読み取り専用です。このプロパティは設計時には使用できません。
シンタックス
'宣言
 
Public ReadOnly Property DataChanged As Boolean
public bool DataChanged {get;}
解説

このプロパティは、セルまたは行のデータが変更されているが、まだこれらの変更がデータソースにコミットされていない場合に True を返します。そうでなければ False を返します。

セルの値が変更されると、プログラムでその Value プロパティまたはユーザー操作で設定します。このプロパティは True に設定され、BeforeCellUpdate および AfterCellUpdate イベントが生成されます。ただし、実際に更新が発生するときに、データソースが採用するレコードのロックのタイプや UpdateMode プロパティの値などのさまざまな要素が影響する可能性があるため、セルの新しい値がこの時点でデータソースにコミットされている必要はありません。データソースが実際に更新されると、BeforeRowUpdate および AfterRowUpdate イベントが生成され、このプロパティの値は False に戻ります。

セルの OriginalValue プロパティは、変更前にセルの値を決定するために使用できます。

使用例
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics

   Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

       ' Assign the UpdateMode to OnRowChange to test code below. If it's left
       ' to its default value of OnRowChangeOrLostFocus, then clicking on the button will cause the
       ' UltraGrid to lose focus and update the row before the button handler gets executed and we
       ' won't be able to illustrate the DataChanged and Update methods below.
       Me.ultraGrid1.UpdateMode = UpdateMode.OnRowChange

   End Sub

   Private Sub Button65_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button65.Click

       ' Following code updates the active row if it has been modified. To test 
       ' this sample code out, modify one or more cells and then call this method
       ' on the 

       Dim row As UltraGridRow = Me.ultraGrid1.ActiveRow

       If Not row Is Nothing Then

           ' Check to see if the user has modified the data in the row.
           If row.DataChanged Then
               ' Update the row. This will call EndEdit on the underlying data row.
               row.Update()
               Debug.WriteLine("After Update row.DataChanged = " & row.DataChanged)
           Else
               Debug.WriteLine("The row has not been modified since last updated.")
           End If

       Else
           Debug.WriteLine("No active row.")
       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)
{

	// Assign the UpdateMode to OnRowChange to test code below. If it's left
	// to its default value of OnRowChangeOrLostFocus, then clicking on the button will cause the
	// UltraGrid to lose focus and update the row before the button handler gets executed and we
	// won't be able to illustrate the DataChanged and Update methods below.
	this.ultraGrid1.UpdateMode = UpdateMode.OnRowChange;

}

private void button65_Click(object sender, System.EventArgs e)
{

	// Following code updates the active row if it has been modified. To test 
	// this sample code out, modify one or more cells and then call this method
	// on the 

	UltraGridRow row = this.ultraGrid1.ActiveRow;

	if ( null != row  )
	{
		// Check to see if the user has modified the data in the row.
		if ( row.DataChanged )
		{
			// Update the row. This will call EndEdit on the underlying data row.
			row.Update( );
			Debug.WriteLine( "After Update row.DataChanged = " + row.DataChanged );
		}
		else
		{
			Debug.WriteLine( "The row has not been modified since last updated." );
		}
	}
	else
	{
		Debug.WriteLine( "No active row." );
	}

}
参照