New to Telerik UI for WPF? Download free 30-day trial

AutoCommit Settings

RadDataForm exclusively relies on data binding, so changes are actually committed when the respective bindings push the changes back to their sources, so that the term “Commit” actually refers to a confirmation that processed data has passed all the validation checks and the user is willing to end the editing operation, persisting edited item’s current state. On the other hand “Cancel” (when it is available) would make the state revert to item’s initial one. This article describes RadDataForm’s two alternating behaviors of committing pending changes.

AutoCommit Is True

The default value of RadDataForm’s AutoCommit property is True. In this mode RadDataForm automatically commits any changes on the current item, when a command different from Delete or Cancel is carried out. Here is an example:

Figure 1: DataForm with AutoCommit Set to True and in View Mode

raddataform-auto-commit-1

When entering edit mode (i.e. when the AutoCommit is True), all commands, but BeginEdit are enabled.

Figure 2: DataForm with AutoCommit Set to True and in Edit Mode

raddataform-auto-commit-2

Applying changes on the current item keeps the commands enabled. Moving to the next item will automatically commit the current edit operation.

AutoCommit Is False

Please, be advised that the following changes regarding AutoCommit = false are available after the 2012 Q1 Service Pack version of the RadControls. RadDataForm requires its business type to implement INotifyPropertyChanged, in order to utilize this mode properly. In case the mentioned interface is not implemented, the control falls back to its default behavior. RadDataForm with AutoCommit = false mode forces its users to commit any changes, by using the CommitEdit command (the Ok button). The commands for Cancel, Delete and OK are enabled if there are any present uncommitted changes. In that case all the other commands are disabled. And here comes the example:

Figure 3: DataForm with AutoCommit Set to False and in View Mode

raddataform-auto-commit-3

When entering edit mode, the Commit and Cancel commands are initially disabled, as there are no pending changes to commit or cancel. On the other hand, all the other commands are enabled.

Figure 4: DataForm with AutoCommit Set to False and in Edit Mode

raddataform-auto-commit-4

When changes are applied, the Navigation and AddNew commands get disabled, until the editing operation is committed, or cancelled.

As TextBox’s Text property binding is triggered on control’s LostFocus, any UI initiated modifications are considered changes, even before the respective property value is updated. Users’ experience should not vary when different AutoEdit options are used alongside with any of the AutoCommit modes.

In this article