Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
I have a project where I'm using the Dashboard Layout and I found an issue where a child component that contains a dashboard panel doesn't rerender the component's content on StateHasChanged or InvokeAsync(StateHasChanged). A workaround is to tell the SfDashboardLayout component to move the child component's panel to the same position.
Possible linked issues:
Minimal Code to Reproduce, Minimal Project also attached:
@page "/"
@using Syncfusion.Blazor.Layouts
<Incrementer />
<SfDashboardLayout Columns="12" @ref="dashboard">
<DashboardLayoutPanels>
<PanelIncrementer Dashboard="dashboard">
</DashboardLayoutPanels>
</SfDashboardLayout>
@code {
private SfDashboardLayout dashboard;
}
Incrementer.razor:
<button @onclick="Increment">Increment i</button>
<br />
i: @i
@code {
private int i = 0;
private async void Increment()
{
i++;
await InvokeAsync(StateHasChanged);
}
}
PanelIncrementer.razor:
@using Syncfusion.Blazor.Layouts
<DashboardLayoutPanel SizeX="1" SizeY="1" Row="0" Column="0" @ref="panel">
<ContentTemplate>
<button @onclick="Increment">Increment i</button>
<br />
i: @i
</ContentTemplate>
</DashboardLayoutPanel>
@code {
private int i = 0;
[Parameter]
public SfDashboardLayout Dashboard { get; set; }
private DashboardLayoutPanel panel;
private async void Increment()
{
if (i++ % 2 == 0)
{
await InvokeAsync(StateHasChanged);
}
else
{
await Dashboard.MovePanelAsync(panel.Id, panel.Row, panel.Column);
}
}
}