# 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**

![WinUI RadDataForm raddataform-auto-commit-1](https://www.telerik.com/winui/documentation/assets/4676cfea5313c300310de7cda2c36a0f/raddataform-auto-commit-1.png)

When entering the edit mode (`AutoCommit` is `True`), all commands except for `BeginEdit` are enabled.

**DataForm in Edit Mode with Enabled AutoCommit**

![WinUI RadDataForm raddataform-auto-commit-2](https://www.telerik.com/winui/documentation/assets/264e4d4a63d88c183e495f32a82c14a8/raddataform-auto-commit-2.png)

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**

![WinUI RadDataForm raddataform-auto-commit-3](https://www.telerik.com/winui/documentation/assets/287bd6595196a9470a20b4a028380aa4/raddataform-auto-commit-3.png)

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**

![WinUI RadDataForm raddataform-auto-commit-4](https://www.telerik.com/winui/documentation/assets/c0f502d59976b69e4c1faa26c4c90aab/raddataform-auto-commit-4.png)

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

> caution As the `Text` property binding of the TextBox is triggered on the `LostFocus` 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 different `AutoEdit` options are used alongside any `AutoCommit` modes.
