How do you implement IValidatableObject with RadzenTemplateForm

I would like to implement custom validator OnSubmit actually OnValidSubmit but since RadzenTemplateForm doesnt have any event as OnValidSubmit, I believe that it leaves me only option to use OnSubmit ? If that is the case how can I fire this like using EditForm?

RadzenTemplateForm fires the Submit event only when validation passes.

I dont really quite understand I try to extend RequiredIfAttribute : RequiredAttribute using some conditions but it doesnt work using RadzenTemplateForm. Is it restricted with the basic annotations?

The Radzen.Blazor validation components do not use annotation attributes. If you want to extend those attributes you should use the built-in Blazor validation (EditForm, ValidationMessage etc.)

1 Like

Hi @korchev can I mix build-in Blazor form with Radzen controls?
I have my model as IValidatableObject and want to use custom validation and custom messages.

Hi @Muhammad_Ali,

Yes, you can use Radzen components with EditForm. The validator components won't work though - they only work inside RadzenTemplateForm.