AutoCommit
The DataForm exclusively relies on data binding.
Any changes in the component are actually committed when the respective bindings push the changes back to their sources. In this way, "commit" actually refers to a confirmation that the processed data has passed all validation checks and the user is willing to end the editing operation and persist the current edited state of the item. On the other hand, "cancel", when available, will revert the state of the item to its initial one.
This article describes the alternating behavior of the DataForm for committing pending changes.
Enabled AutoCommit
By default, the AutoCommit
property of the DataForm is enabled and set to True
. When AutoCommit
is enabled, the component automatically commits any changes in the current item when a command different from Delete
or Cancel
is performed.
DataForm in View Mode with Enabled AutoCommit
When entering the edit mode (AutoCommit
is True
), all commands except for BeginEdit
are enabled.
DataForm in Edit Mode with Enabled AutoCommit
Applying changes to the current item keeps the commands enabled. Moving to the next item will automatically commit the current edit operation.
Disabled AutoCommit
To properly utilize the disabled AutoCommit
mode, the DataForm requires its business type to implement INotifyPropertyChanged
. If the INotifyPropertyChanged
interface is not implemented, the component acquires its default behavior.
A DataForm with disabled AutoCommit
forces its users to commit any changes by using the CommitEdit
command (the Save button). The commands for Cancel
, Delete
, and Save
are enabled if any present changes are uncommitted. In that case, all other commands are disabled.
DataForm in View Mode with Disabled AutoCommit
When entering the edit mode, the Commit
and Cancel
commands are initially disabled because no pending changes to commit or cancel are available. All other commands are enabled.
DataForm in Edit Mode with Disabled AutoCommit
When changes are applied, the Navigation
and AddNew
commands become disabled until the editing operation is committed or cancelled.
As the
Text
property binding of the TextBox is triggered on theLostFocus
event of the DataForm, all UI-initiated modifications are regarded as changes even before the respective property value is updated. The user experience must not vary when differentAutoEdit
options are used alongside anyAutoCommit
modes.