OnInitialized Page to show Required Fields

On a page with a RadzenTemplateForm, I want it to initialize (on load) display the required fields. Even before clicking the submit button. Is that possible?

Attempted the following, but not working:


		<RadzenTemplateForm @ref="temp" TItem="SampleParameters" Data=@_model>

			<RadzenFormField Text="Field1" Style="width: 100%;" Component="Field1">
				<RadzenTextBox Name="Field1" Style="width: 100%;" />
			</RadzenFormField>
			<RadzenRequiredValidator Component="Field1" Text="This field is required" Popup=false />

		</RadzenTemplateForm>

@code {
	SampleParameters _model = new SampleParameters();

	public class SampleParameters
	{
		public string SampleParameter1 { get; set; } = default!;
	}

	public RadzenTemplateForm<SampleParameters> temp;

	protected override async Task OnInitializedAsync() {
		temp.EditContext.Validate();
	}
}

Maybe you can use OnAfterRenderAsync() instead.

Thank you, that worked. Once I changed to OnAfterRenderAsync() and added a @bind-Value to the textbox, it all worked as expected.