The Xamarin.Forms DataForm control is used to display and edit the properties of any data object using a wide range of built-in editors for different data types. Custom editors are also supported. It simplifies the development of various forms such as login, reservation, and data entry. It supports built-in data validation and data annotation., It also provides support for linear and grid layouts, label positioning options, grouping, and more features to design the UI as required.
The Xamarin.Forms DataForm includes built-in support for various editors to handle different data types, as well as custom editors. Built-in editors are automatically generated based on data annotations and the type of field. The following built-in editors are available:
Editing support is provided with the following commit modes that determine when an edited value should be updated in the data object.
The DataForm supports read-only display mode. It also allows specific fields to be made read-only.
Support to show the original value in a different format or as different value using converters.
Support to manually generate data fields without using data object. This is used to load data from another source such as Dictionary. It also has support to read and write from/to another data source.
Provides support for linear and grid layouts.
The linear layout arranges items in a single column.
The grid layout arranges items in a predefined number of columns.
You can change the order of the fields regardless of the position in the data object to view it in the desired position.
Support to add or remove fields and regenerate fields dynamically to show the fields only when required.
You can position the labels to the left or at the top of the editor.
You customize the label and editor width ratio to set the width proportionally based on the requirement.
Support to customize each data field’s width and height for better readability.
Display watermarks to guide end users.
Support to show or hide data form fields dynamically based on the application needs.
Display labels with images for easy comprehension.
Support to exclude specific fields of a data object in UI.
Options to customize data form fields based on data annotation attributes.
Complete control over label and editor customization.
The Xamarin.Forms DataForm supports localizing label text, group name, watermark, and validation messages in the desired language.