RadzenValidate

I am trying to implement RadzenRequiredValidatior to RadzenDropDownDataGrid and I assumed that it is the same as RadzenDropDown example. So I put code for validation like this:

then I receive an error
warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
Unhandled exception rendering component: Cannot find component with Name 019
System.InvalidOperationException: Cannot find component with Name 019
at Radzen.Blazor.ValidatorBase.ValidateModel(Object sender, ValidationRequestedEventArgs args)
at Microsoft.AspNetCore.Components.Forms.EditContext.Validate()
at Radzen.Blazor.RadzenTemplateForm`1.OnSubmit()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

where 019 from an error is the content of the validating field. So I tried another approach to set component without @ and it looks like this "bRRAD.OPSTINA" and an error now looks like this:

warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
Unhandled exception rendering component: Cannot find component with Name bRRAD.OPSTINA
System.InvalidOperationException: Cannot find component with Name bRRAD.OPSTINA
at Radzen.Blazor.ValidatorBase.ValidateModel(Object sender, ValidationRequestedEventArgs args)
at Microsoft.AspNetCore.Components.Forms.EditContext.Validate()
at Radzen.Blazor.RadzenTemplateForm`1.OnSubmit()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

I am out of ideas on what to put in Component. Similar problem I have with the RadzenRadioButtonList validator.

Hi @Djordje,

The Component attribute of the validator should be the same as the Name of the component it validates. It should also be a constant (should not change when the component value changes). Check the demo for reference.

Thank you Atanas, It was crucial to me that name is not any previously defined data but whatever I want. It might be "BlaBla" just to use the same string as the component during validation.