When the component is intialized, I need the inputs to display with the red (invalid) classes and such.
The validation is in place as when I start to enter, then backspace back to empty it TURNS red, but I need it to be red by default when the form initializes.
You can trigger a validation through EditContext's Validate() method. You can check its API here - EditContext.Validate. For example, taking the demo from the Form Docs as a base, you can introduce an OnAfterRender lifecycle method and call the Validate() method within it(source also attached):
protectedoverridevoidOnAfterRender(bool firstRender)
{
if (firstRender)
{
MyEditContext.Validate();
}
base.OnAfterRender(firstRender);
}
Alternatively, the component reference provides you with access to the EditContext that the form will generate when you pass a model, thus calling its Validate() method will also work:
Please do not hesitate to reach out in case of any more questions. Thank you!
Regards,Radko StanevProgress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.