Data annotations

17 Sep 20191 minute to read

The data form supports the following attribute, and these attributes can be accessible using System.ComponentModel.DataAnnotation assembly.

Display attribute

Property Details
Name Specifies label text
GroupName Specifies the group name which is used to group fields in DataForm. Refer

here

for more details.
ShortName Specifies label text. It takes higher priority than Name.
AutoGenerateField Specifies whether the field should be auto generated or not. Refer

here

for more details.
Prompt Specifies watermark text for editor. Refer

here

for more details.
Order Specifies the order of the field in data form. Refer

here

for more details.

Validation attributes

Property Details
MinLength Specifies the minimum required length. Refer

here

for more details.
MaxLength Specifies the maximum required length. Refer

here

for more details.
Required Specifies data field value is required. Refer

here

for more details.
RegularExpression Specified value must match the specific pattern. Refer

here

for more details.
Range Specifies the maximum and minimum value. Refer

here

for more details.

Bindable Attribute

It specifies whether the field should be auto generated or not. Refer here for more details.

Editable Attribute

It specifies data field is editable or not. Refer here for more details.

ReadOnly Attribute

It specifies data field is read only or not. Refer here for more details.

EnumDataType Attribute

It specifies enum type for data field.

DataType Attribute

It specifies data type for the field.
Supported data types - Text, MultilineText, Date, DateTime, Time, Currency.
Refer here for more details.

CustomDataType Attribute

Percent data type is supported. Refer here for more details.

Custom Attributes

The data form supports the following custom attribute, and these attributes can be accessible using Syncfusion.SfDataForm.iOS assembly.

DisplayOptions Attribute

Property Details
RowSpan Specifies the row span for the data form item. Refer

here

for more details.
ColumnSpan Specifies the column span for the data form item. Refer

here

for more details.
ValidMessage Specifies positive message to be shown when validation is passed. Refer

here

for more details.
ImageSource Specifies the image source for loading image instead of label. Refer

here

for more details.
ShowLabel Specifies whether label should be visible or not. Refer

here

for more details.

ConverterAttribute

Property Details
ConverterType Specifies Converter type. It is used to convert the original value in different format or as different value. Refer

here

for more details.

DateRange Attribute

Property Details
MinYear Specifies required minimum year
MinMonth Specifies required minimum month
MinDay Specifies required minimum day
MaxYear Specifies required maximum year
MaxMonth Specifies required maximum month
MaxDay Specifies required maximum day

Refer here for more details.