Telerik UI for Windows Phone by Progress

RadDataForm exposes convenient API to get and set the values of the editors, track value changes and adjust how the current input values in the editors are synched with the properties of the assigned business object.

Committing the Editor Values to the Business Entity

To commit the values of the editors within a RadDataForm instance you should use the Commit method exposed by the control. When the Commit method is called RadDataForm validates the input in the editors and in case no errors are found, the values in the editors are stored in the corresponding properties.

Using the CommitMode property

RadDataForm exposes the CommitMode property which can be used to define when the editor values are synched with the corresponding properties on the business object. The CommitMode property can be set to one of the following values:

  • Manual
  • OnFieldValueChange

When the commit mode is set to be Manual then you will have to use the Commit method to synch the values.

When the commit mode is set to be OnFieldValueChange the values are automatically synched as soon as the value of the editor changes.

Reading values of editors

To read the value of an editor you should find the editor and use its Value property. The following code snippet demonstrates how this is done:

DataFormField editorField = this.radDataForm.FindFieldByPropertyName("SecondName");

string secondName = editorField.Value as string;

Tracking value changes

You can track when a value of an editor changes by handling the DataFieldValueChanged event exposed by RadDataForm. The event contains information about the field which value has changed.