'Declaration Public Property UpdateMode As UpdateMode
public UpdateMode UpdateMode {get; set;}
Use this property to specify when updates are committed back to the data source, either based on user interaction, upon row or cell change, or programmatically, when the UpdateData method is invoked.
When this property is set to OnRowChange or OnCellChange, updates are committed to the data source when the user leaves a row or cell, respectively, that has been modified. When a cell that has been modified loses focus, its DataChanged property is set to True and the BeforeCellUpdate event is generated. Similarly, when a row that has been modified loses focus, its DataChanged property is set to True and the BeforeRowUpdate event is generated.
When this property is set to OnUpdate, no updates are actually committed to the data source until the UpdateData method is invoked or until EndEdit is received from the binding manager. Note that there are circumstances where the binding manager will invoke EndEdit whenever the Position is changed, which obviates the use of the OnUpdate setting. This behavior is due to the implementation of the binding manager and is outside the control of the component.
If an attempt is made to update a data source that cannot be updated, the Error event is generated.
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Private Sub Form1_Load(sender as object, e as System.EventArgs) Handles MyBase.Load Me.OleDbDataAdapter1.Fill( Me.DataSet21 ) ' Bind the UltraGrid to a data source whose underlying row objects implement ' IEditableObject interface to demonstrate the UpdateData method. Me.UltraGrid1.DataSource = Me.DataSet21 ' Set the UpdateMode to OnRowChange. BeforeRowUpdate event handler below prints ' out whenever a row is being updated. Me.ultraGrid1.UpdateMode = UpdateMode.OnRowChange End Sub Private Sub UltraGrid1_BeforeRowUpdate(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CancelableRowEventArgs) Handles ultraGrid1.BeforeRowUpdate ' Following code will write out whenever the row is being updated to illustate when a ' modified row gets updated with various UpdateMode settings. Debug.WriteLine("Canceling the row update on row with list index of " & e.Row.ListIndex) 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.oleDbDataAdapter1.Fill( this.dataSet21 ); // Bind the UltraGrid to a data source whose underlying row objects implement // IEditableObject interface to demonstrate the UpdateData method. this.ultraGrid1.DataSource = this.dataSet21; // Set the UpdateMode to OnRowChange. BeforeRowUpdate event handler below prints // out whenever a row is being updated. this.ultraGrid1.UpdateMode = UpdateMode.OnRowChange; } private void ultraGrid1_BeforeRowUpdate(object sender, Infragistics.Win.UltraWinGrid.CancelableRowEventArgs e) { // Following code will write out whenever the row is being updated to illustate when a // modified row gets updated with various UpdateMode settings. Debug.WriteLine( "Canceling the row update on row with list index of " + e.Row.ListIndex ); }
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