Update data inside dialog

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>&nbsp;</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

You should invoke the StateHasChanged method of the Dialog component itself. At the moment you are probably invoking the method of its parent which won't work. You may have to create a separate Blazor page for the dialog.

Hello, @korchev, thanks for the awnser!

Is there any samples on the documentation I haven't found any

Best regards

The dialog example shows how to use a separate page.