RadzenRequiredValidator when checkbox is unchecked

The RadzenRequiredValidator is implemented automatically during code generation by Radzen Blazor Studio 1.5.2.
Unfortunately, all these checkboxes cannot be save to database as checked=bit set=true to SQL Server, since the RadzenRequiredValidator fires once a checkbox is not checked.

In a correct way, the RadzenRequiredValidator should fire only, as long as the check-box is in a unset-state, equal to NULL.

I have tried many different configurations. However, with no success.

SQL Field, for example:
ALTER TABLE [dbo].[AspNetUsers] ADD CONSTRAINT [DF_AspNetUsers_PhoneNumberConfirmed] DEFAULT ((0)) FOR [PhoneNumberConfirmed]
GO

Razor Code:


<RadzenCheckBox @bind-Value="@aspNetUser.PhoneNumberConfirmed" Name="PhoneNumberConfirmed" />

Hi @techsc,

I was able to reproduce the problem and we will do our best to provide fix for this in our next update. In the meantime you can remove the validator for this component.

2 Likes