Radzen Components stop working when mixed render modes are used

Hi, I believe this issue may be related to a rendering problem.

When I create a default Blazor project using .NET 8 with interactivity set per page/component, and I add the following line to the MainLayout:
<RadzenComponents @rendermode="InteractiveAuto" />

I noticed that if any child components rendered within this layout use a different InteractiveRenderMode, such as WebAssembly, then Radzen services (e.g., DialogService) stop working properly.

Here’s a simple scenario to illustrate the issue:

  • The RadzenComponents are rendered in the layout.
  • A child component of the layout uses @rendermode="InteractiveWebAssembly".

In this setup, Radzen features such as modals/dialogs do only work for the mode specified in the child component in the layout.

Cant share the default app code because im a new user.
Steps to Reproduce:

  1. Create a default Blazor WebAssembly or Server project in .NET 8 with interactive rendering set per page/component.
  2. Install and configure Radzen
  3. In MainLayout.razor, add the Radzen initialization tag:
<RadzenComponents @rendermode="InteractiveAuto" />
  1. Add any component to be rendered inside the layout (or as a descendant of it) that uses a specific render mode, for example:
<SomeComponent @rendermode=InteractiveWebAssembly>

  1. In the app try to use the dialog service, it only works in one render mode(the mode specified in SomeComponent in the 4step)

Expected Behavior: Radzen services should function normally regardless of the render mode used by a descendent of the the main layout.

Actual Behavior: Radzen services stop working when the child component uses a different InteractiveRenderMode (e.g., InteractiveWebAssembly) than the one used in the layout

No. You need to either specify explicitly or inherit interactive render mode or no Blazor event will work no matter in Radzen components or plain Blazor/HTML components.

Radzen services won't work as they can't cross render mode boundaries. This case is not supported I am afraid and there is no way to support it.

No. I said that services (DialogService, NotificationService etc.) don't work when mixed rendering modes are used. Radzen Blazor components support Blazor web apps and saying otherwise is just wrong.

Good morning:

We've just created a GitHub repository with an example that allows you to reproduce the problem we mentioned:

In the example, in the MainLayout.razor.cs file, we've added the RadzenComponents component twice, one for each rendering mode (InteractiveServer and InteractiveWebAssembly). This way, the application works correctly.

If only one of them is added, the RadzenDialog component will only work on pages with the same rendering mode. Furthermore, if it's added with the InteractiveAuto rendering mode, it will only work with the rendering mode used by the first page displayed.

Shouldn't it be possible to use Radzen components with different rendering modes within the application? If this is possible, is it correct to duplicate the RadzenComponents component in the MainLayout.razor.cs file as we did in the example? Should the configuration be done differently?

Thank you very much.

Best regards.

Unfortunately I don't think this is possible. Those components (dialog, notification, tooltip and others) rely on a service. When you use mixed rendering modes that service is probably not the same instance hence <RadzenDialog /> never gets notified that you want to open it. Feel free to trace the source code in order to verify.

If it works why not? Just make sure you don't end up with two instances of the same dialog open.