I have two RadzenNumeric items for my minimum and maximum values.
I want to bind the max value of the first to the min value of the second to make sure the minimum value cannot be greater than the maximum value.
I use this code:
<RadzenLabel Text="Minimum number of required volunteers" Component="MinimumRequired" class="mandatory" title="This field is mandatory" />
<RadzenNumeric Name="MinimumRequired" TValue="int" Min="1" @bind-Value="TItem.MinimumRequired" />
<RadzenRequiredValidator Component="MinimumRequired" Text="Minimum required is mandatory" Popup="true" />
<RadzenNumericRangeValidator Component="MinimumRequired" Min="1" Max="@TItem.MaximumRequired" Text="Quantity should be between 1 and the maximum value" />
<RadzenLabel Text="Maximum number of required volunteers" class="mandatory" title="This field is mandatory" />
<RadzenNumeric Name="MaximumRequired" TValue="int" Min="@(TItem.MinimumRequired)" @bind-Value="TItem.MaximumRequired" />
<RadzenRequiredValidator Component="MaximumRequired" Text="Maximum required is mandatory" Popup="true" />
<RadzenNumericRangeValidator Component="MaximumRequired" Min="@TItem.MinimumRequired" Max="100" Text="Quantity should be between the minimum value and 100" />
This works, almost.
I start with 1 for min and max. When I increase the min I get the message the value should be between 1 and max. This is correct.
But when I then increase the max to 5, the invalid message for the min stays active. When I now change min again (and stay below the max) the invalid message disappears.
How do I let the min component validate itself when I change the max component?