Data Validation not working with Visible="false" columns && Annotation validation not working for complex objects

Hello, Im trying to set up an edit and create form for a complex Branch object that has a Location and company object within it.



 Im using a dialog template to create the edit form and have seem to have properly set up the columns and edit fields


1) The first problem im having is that the validation for the location fields in the edit template are not properly triggering on submit if i set their gridColumn to Visible="false" but their it does work if them to visible


2) The second problem I am having is that even when they are visible, the validation only works if ValidationRules are set. It does not work with the annotations.


This is only happening with the complex objects that are within the branch object. the validation within the branch object itself works fine.

If you can please have a look and see if you can find a way for me to use on submit validation with complex invisible fields, that would be great. problem number 2 while slightly inconvenient is not critical. I can alway


1 Reply

SP Sarveswaran Palani Syncfusion Team July 18, 2022 05:40 PM UTC

Hi Taras,


Greetings from Syncfusion support.


Query 1: “ Validation for the location fields in the edit template are not properly triggering on submit if I set their gridColumn to Visible="false"


We have analyzed your query and we would like to inform you that column isn’t rendering when you assign visible property as false. So, it doesn’t able to validate the local fields.

If we misunderstood your query, please get back to us


Query 2: “ The validation only works if ValidationRules are set. It does not work with the annotations


Based on your provided snippet, we suggest you to perform validation for complex data binding columns using the ValidateComplexType attribute of data annotation. We have already detailly discussed about these topics in our UG documentation. Kindly refer the documentation links shared.


https://blazor.syncfusion.com/documentation/datagrid/column-validation#validate-complex-column-using-data-annotation-attribute


Kindly get back to us if you have any further queries


Regards,

Sarveswaran PK


Loader.
Up arrow icon