Trigger form validation manually RadzenTemplateForm

I want to fetch data from the database and populate it into forms when the page loads. Afterward, I want to immediately execute validation so that errors are displayed in red for correction.

<RadzenTemplateForm @ref=xForm TItem="xModel" Data=@SelectedX Submit="@Soumettre" InvalidSubmit="@OnInvalid">
     <ChildContent Context="formContext">
         <DataAnnotationsValidator />

if (!xForm.IsValid) : Use this instruction to ensure that form is valid but i want in
protected override async Task OnInitializedAsync() Run validation.


EditContext.Validate() can do that:

1 Like

Thanks it is good :

protected override async Task OnAfterRenderAsync(bool firstRender)
    if (xForm != null)