Version

DataChanged Property (UltraGridCell)

Returns a value that determines whether the data in a cell or row has been changed, but not committed to the data source. This property is read-only at run-time. This property is not available at design-time.
Syntax
'Declaration
 
Public ReadOnly Property DataChanged As Boolean
public bool DataChanged {get;}
Remarks

This property returns True when a cell or row's data has changed, but has not yet been committed to the data source; otherwise, it returns False.

When the value of a cell is changed, either programmatically by setting its Value property, or by user interaction, this property is set to True and the BeforeCellUpdate and AfterCellUpdate events are generated. Note that the cell's new value is not necessarily committed to the data source at this time, however, since various factors such as the type of record locking employed by the data source, as well as the value of the UpdateMode property, can affect when the actual update occurs. Once the data source is actually updated, the BeforeRowUpdate and AfterRowUpdate events are generated and this property is set back to False.

The OriginalValue property of the cell can be used to determine a cell's value before it was changed.

Example
DataChanged property off the UltraGridCell returns true if the cell has been modified since the associated row was last updated. DataChanged property also returns true if any of its cells are modified since the row was last updated.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics

   Private Sub Button107_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button107.Click

       Dim row As UltraGridRow = Me.UltraGrid1.Rows(0)
       Dim cell As UltraGridCell = row.Cells("Phone")

       ' Write ou the cell's and the row's DataChanged property values.
       Debug.WriteLine("Before setting the cell's Value, cell.DataChanged = " & cell.DataChanged)
       Debug.WriteLine("Before setting the cell's Value, row.DataChanged = " & row.DataChanged)

       cell.Value = "123456789"

       ' DataChanged properties should return true given the cell's previous value was something
       ' other than "123456789".
       Debug.WriteLine("After setting the cell's Value, cell.DataChanged = " & cell.DataChanged)
       Debug.WriteLine("After setting the cell's Value, row.DataChanged = " & row.DataChanged)

   End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

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

	UltraGridRow row = this.ultraGrid1.Rows[0];
	UltraGridCell cell = row.Cells["Phone"];

	// Write ou the cell's and the row's DataChanged property values.
	Debug.WriteLine( "Before setting the cell's Value, cell.DataChanged = " + cell.DataChanged );
	Debug.WriteLine( "Before setting the cell's Value, row.DataChanged = " + row.DataChanged );

	cell.Value = "123456789";

	// DataChanged properties should return true given the cell's previous value was something
	// other than "123456789".
	Debug.WriteLine( "After setting the cell's Value, cell.DataChanged = " + cell.DataChanged );
	Debug.WriteLine( "After setting the cell's Value, row.DataChanged = " + row.DataChanged );

}
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