Use layout for Radzen Dialogs

Hi,

Thanks for making the Radzen components!

I am a bit stuck on applying a layout for all my Radzen Dialogs. I want the layout to be the same for all my Dialogs. @layout DialogLayout is not working. Is there another way to apply the same layout to all my dialogs?

It should work if you use the LayoutView component LayoutView Class (Microsoft.AspNetCore.Components) | Microsoft Learn

Thanks for your quick response! Layoutview is not working in the Radzen Dialog.
If I call the page directly using the path, then the Layoutview is working properly.

This works:

async Task ShowInlineDialog()
    {
     var result = await DialogService.OpenAsync("Simple Dialog", ds =>
        @<LayoutView Layout="typeof(MainLayout)">
            <p class="mb-4">Confirm Order ID <b>@orderID</b>?</p>
            <div class="row">
                <div class="col">
                    <RadzenButton Text="Ok" Click="() => ds.Close(true)" Class="me-1" Style="width: 80px;" />
                    <RadzenButton Text="Cancel" Click="() => ds.Close(false)" ButtonStyle="ButtonStyle.Light" Class="me-1" />
                    <RadzenButton Text="Refresh" Click="(() => { orderID = 10249; ds.Refresh(); })" ButtonStyle="ButtonStyle.Light"  Class="me-1 float-end" />

                </div>
            </div>
        </LayoutView>);
}

1 Like