I needed to read the response from the upload as well as capture the form values
It uploads the file within FormSubmit() so when it's done, the form values are available in OnCompleteAsync(), I read the response as needed, then save the entity.
I just double checked and at the moment you can't do that. RadzenUpload doesn't have a "value" at the moment so it can't be validated with a RadzenRequiredValidator. We have to see if we can enable this scenario.
We thought a bit how to implement such a feature but there are a lot of unknowns. What is a valid RadzenUpload? One with a selected file or one with an uploaded file? What if the upload fails for some reason (file too big, invalid extension etc)? Perhaps it is better to use a custom validator and manually check if a file has been uploaded or not.
For my use case I simply need to know if they selected a file, no different that if they filled in a text box or selected a value from a drop down etc.
If the upload fails, is that not the same as anything else failing within FormSubmit()?
As written it doesn't know if the upload specifically failed or it was something else, but if you have a lot of things happening in your FormSubmit() it would be no different.
I changed my error message to "Cannot save, did you select your file?" which is intended to say to the end user: something didn't work, it could be you didn't select the file but it could be something else.
I am not sure if this is sufficient. RadzenUpload will not upload the file when the user submits the form.
No as the upload is separate from the form submission.
Your current implementation can probably use RadzenCustomValidator and use upload.HasValue for the condition. Then the FormSubmit event won't fire if the validator fails.
No as the upload is separate from the form submission.
Not always, it's not the way I implemented, I set Auto='false' so I could do it as part of FormSubmit() as I wanted to upload the file and save the form values at the same time.