Data Annotations
17 Sep 20192 minutes 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 the label text. |
GroupName | Specifies the group name which groups the fields in the data form. Refer to for more details. |
ShortName | Specifies the label text. It takes higher priority than Name. |
AutoGenerateField | Specifies whether the field should be auto generated or not. Refer to for more details. |
Prompt | Specifies watermark text for the editor. Refer to for more details. |
Order | Specifies the order of field in the data form. Refer to for more details. |
Validation attributes
Property | Details |
---|---|
MinLength | Specifies the required minimum length. Refer to for more details. |
MaxLength | Specifies the required maximum length. Refer to for more details. |
Required | Specifies the required data field value. Refer to for more details. |
RegularExpression | Specifies the value matches the specific pattern. Refer to for more details. |
Range | Specifies the maximum and minimum values. Refer to for more details. |
Bindable attribute
It specifies whether the field should be auto generated or not. Refer to here for more details.
Editable attribute
It specifies whether the data field is editable or not. Refer to here for more details.
ReadOnly attribute
It specifies whether the data field is read only or not. Refer to here for more details.
EnumDataType attribute
It specifies enum type for the data field. Refer to here for more details.
DataType attribute
It specifies data type for the field.
Supported data types are Text, MultilineText, Date, DateTime, Time, and Currency.
Refer to here for more details.
CustomDataType attribute
The Percent data type is supported. Refer to here for more details.
Custom attributes
The data form supports the following custom attribute, and these attributes can be accessible using Syncfusion.SfDataForm.Android
assembly.
DisplayOptions attribute
Property | Details |
---|---|
RowSpan | Specifies the row span for the data form item. Refer to for more details. |
ColumnSpan | Specifies the column span for the data form item. Refer to for more details. |
ValidMessage | Specifies positive message to be shown when validation is passed. Refer to for more details. |
ImageSource | Specifies the image source for loading image instead of label. Refer to for more details. |
ShowLabel | Specifies whether the label should be visible or not. Refer to for more details. |
Converter attribute
Property | Details |
---|---|
ConverterType | Specifies the Converter type which converts the original value in different format or as different value. Refer to here for more details. |
DateRange attribute
Property | Details |
---|---|
MinYear | Specifies the required minimum year. |
MinMonth | Specifies the required minimum month. |
MinDay | Specifies the required minimum day. |
MaxYear | Specifies the required maximum year. |
MaxMonth | Specifies the required maximum month. |
MaxDay | Specifies the required maximum day. |
Refer to here for more details.