Hello Radzen Team!
This is a complicated explanation, so I'll add some pictures.
My TemplateForm is as follows:
The + button opens the CreateDocument dialog:
After creating the new document, it is programmatically selected from the dropdown:
Now it's time to complete the form:
As you can see the DatePicker RequiredValidator is not validating correctly in this particular case. This only happens if I create a new Document and then overwrite the object who's property is binded to the DatePicker value. Also the RV becomes visible as soon as I select a value in the DatePicker, not when I submit the form by clicking the save button, which I cannot do of course because of it.
Everything works as normal if I just select an existing document and then complete the form. The DatePicker RequiredValidator only shows up when I submit the form and there is no value in it. Down below there are some more configs.
The button Click event is the following:
The DatePicker properties are set like this:
And its RequiredValidator is as shown below:
UPDATE:
Did some testing and indeed by overwriting the form object it breaks the DatePicker RequiredValidator.
I added a Test button just to bind the personDocument to a new one, and managed to replicate the error:
The Text button's Click event: