Thank you for contacting Syncfusion support.
Query 1: Regarding validation while AutoGeneration set to false
As per SfDataForm implementation, if we set AutoGeneration to false, DataFormItems will generate from XAML page but it will capture the details of curresponding property from the data model. So if you set validation attributes to the property then validation will perform as default
Please refer the following code example for the same,
[C#]
[Required(AllowEmptyStrings = false, ErrorMessage = "Name should not be empty")]
public String Name { get; set; }
[StringLength(16,MinimumLength =8 , ErrorMessage = "Password should have 8-16 characters")]
public String Password { get; set; } |
Kindly refer our UG documentation to know more about validation in DataForm,
Query 2: Regarding editors with values on initial loading while AutoGeneration set to false
As we have mentioned, DataFormItem will generate with respective property information so if you set value for the property DatForm editors will have the value on initial loading.
Please refer the following code example for the same,
[C#]
public ContactInfo()
{
contactDetails = new Contacts();
contactDetails.Name = "Jhon";
} |
We have prepared a sample based on your requirement, please find the sample by the following link.
In the sample, as per your requirement we have set validation attributes for validation and set values for properties on initial loading.
We hope this helps. Please let us know, if you need any further assistance.
Regards,
Karthik Raja A