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.
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." ); } }
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