Hello everyone! I have the following dialog
@code {
async Task OpenNewIngredientModal() => await DialogService.OpenAsync("Adicionar ingrediente", ds =>
@<Radzen.Blazor.RadzenPanel Style="padding-top:0px">
<div class="row">
<div class="col-8">
<label>Nome</label>
<br />
<RadzenTextBox Style="width:100%" @bind-Value="IngredientName" Placeholder="Nome do ingrediente"></RadzenTextBox>
</div>
<div class="col-4">
<label> </label>
<br />
<label>Disponível </label>
<RadzenCheckBox @bind-Value="IsAvailable"></RadzenCheckBox>
</div>
</div>
<br />
@if (Errors != null)
{
@foreach (var error in ModalErrors)
{
<label style="color:red">@error</label>
}
<br />
}
<div class="row">
<div class="col-md-12">
<RadzenButton Text="Ok" Click="() => AddIngredient(() => ds.Close())" Style="margin-bottom: 10px; width: 150px" />
<RadzenButton Text="Cancel" Click="()=> ds.Close(false)" ButtonStyle="ButtonStyle.Secondary" Style="margin-bottom: 10px; width: 150px" />
</div>
</div>
</Radzen.Blazor.RadzenPanel>);
}
Whenever I receive a callbak from the server with the possible errors and populate ModalErrors list the errors are not shown until I close the dialog and open it again.
ModalErrors.AddRange(response.Messages);
ModalErrors = ModalErrors.OrderBy(x => x).ToList();
StateHasChanged();
Am I missing something?
Thanks in advance