Declined
Last Updated: 17 Apr 2025 09:54 by ADMIN
Frank
Created on: 16 Apr 2025 13:22
Category: UI for Blazor
Type: Bug Report
0
TelerikDialog breaking rerendering of children

Hello,

I am currently reworking an old webapp with server-side Blazor and Telerik UI for Blazor. I noticed that TelerikDialogs kind of break the rerendering of child components if the TelerikDialog and all of its content are placed inside their own component:

<PageTitle>Home</PageTitle>

<EditWithDialog @ref="EditDialogInside"></EditWithDialog>

Where EditWithDialog is (basically) defined as follows:

<TelerikDialog @ref="Dialog" @bind-Visible="@Visible">
	<DialogTitle>
		Edit ID
	</DialogTitle>
	<DialogContent>
		<div>
			<div>TelerikDialog inside of component</div>
			<TelerikTextBox Value="@AppState.CustomerString" OnChange="@SetID" Width="300px"></TelerikTextBox>
			<TelerikButton OnClick="@GenerateID">Generate ID</TelerikButton>
		</div>
	</DialogContent>
	<DialogButtons>
		<TelerikButton OnClick="@ToggleVisible">Close</TelerikButton>
	</DialogButtons>
</TelerikDialog>

 

However, if the TelerikDialog is placed on a page and its content is placed inside of its own component, everything works as expected:

<PageTitle>Home</PageTitle>
<TelerikDialog @bind-Visible="@Visible">
	<DialogTitle>
		Edit ID
	</DialogTitle>
	<DialogContent>
		<div>
			<div>TelerikDialog outside of component</div>
			<EditWithoutDialog @ref="EditDialogOutside"></EditWithoutDialog>
		</div>
	</DialogContent>
	<DialogButtons>
		<TelerikButton OnClick="@ToggleEditOutside">Close</TelerikButton>
	</DialogButtons>
</TelerikDialog>

EditWithoutDialog.razor:

<TelerikTextBox Value="@AppState.CustomerString" OnChange="@SetID" Width="300px"></TelerikTextBox>
<TelerikButton OnClick="@GenerateID">Generate ID</TelerikButton>

I am using the state-container approach described here, but the problem persists when using two-way binding via parameters.

In this scenario, putting the dialog directly on the page is not a problem, but with larger applications where there's possibly multiple dialogs and a lot more content on one page, this can become very unwieldy and confusing. Considering Blazors emphasis on making components reusable, this also prevents proper use of a customized dialog component that uses the TelerikDialog as a base.

I have attached a small project that implements both versions on a single page for you to test. I have tested using both Edge and Firefox.

Attached Files:
1 comment
ADMIN
Dimo
Posted on: 17 Apr 2025 09:54

Hi Frank,

Please Refresh() the Dialog when making programmatic changes to its UI.

	private void GenerateID()
	{
		AppState.Customer = Guid.NewGuid();
		Dialog?.Refresh();
	}

 

Regards,
Dimo
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!