Data NavigatorCommit Changes Method
This is used to manually commit pending changes to the current row in the data source
Definition
Namespace: EWSoftware.ListControls
Assembly: EWSoftware.ListControls (in EWSoftware.ListControls.dll) Version: 2024.12.31.0
Assembly: EWSoftware.ListControls (in EWSoftware.ListControls.dll) Version: 2024.12.31.0
C#
public void CommitChanges()VB
Public Sub CommitChangesC++
public:
void CommitChanges()F#
member CommitChanges : unit -> unit Remarks
This will call the EndCurrentEdit method for the data source in the current binding context.
Due to the way data binding works in .NET, pending changes to the current row may not have been committed to the data source when you are ready to save changes to the underlying data source. As such, you should always call the CommitChanges or CancelChanges method on the data navigator control prior to checking for or saving changes in its underlying data source.
Example
Assume dataSet has been assigned to dataNav as its
data source.
C#
// Commit any pending edits in the data source
dataNav.CommitChanges();
// If changes were made to the data source, save them
if(dataSet.HasChanges())
dataAdapter.Update(dataSet);VB
' Commit any pending edits in the data source
dataNav.CommitChanges()
' If changes were made to the data source, save them
If dataSet.HasChanges() Then
dataAdapter.Update(dataSet)
End IfC++
No code example is currently available or this language may not be supported.F#
No code example is currently available or this language may not be supported.