@using Syncfusion.Blazor.Buttons
<div style="padding:20px;">
<SfButton Content="Remove Panel" OnClick="Removepanel"></SfButton>
<SfButton Content="Add Panel" OnClick="addPanel"></SfButton>
</div>
<Counter @ref="dashboard_value"></Counter>
@code {
// Reference for Counter page.
Counter dashboard_value;
public void Removepanel()
{
// It Triggers the method declare in Child component.
this.dashboard_value.Removepanel_child_method();
}
public void addPanel()
{
// It Triggers the method declare in Child component.
this.dashboard_value.addPanel_child_method();
}
} |
@using Syncfusion.Blazor.Layouts
<SfDashboardLayout @ref="dashboard" CellSpacing="@(new double[]{10 ,10 })" Columns="5">
<DashboardLayoutPanels>
<DashboardLayoutPanel Id="panel1">
<ContentTemplate><div>Dashboard Panel</div></ContentTemplate>
</DashboardLayoutPanel>
</DashboardLayoutPanels>
</SfDashboardLayout>
@code{
SfDashboardLayout dashboard;
public void Removepanel_child_method()
{
this.dashboard.RemoveAll();
}
public void addPanel_child_method()
{
this.dashboard.AddPanel(new PanelModel
{
SizeX = 2,
SizeY = 1,
Row = 0,
Col = 0,
Content =@<div style="height:100%; width:100%;">
<SfButton Content="Newly Added panel"></SfButton>
</div>,
Header = @<div> New Panel</div>,
});
}
} |
Is there any way I can hide and show the panels inside Dashboard Layout ? Everything I tried di
Hi Andi,
Looks like there is another forum for the same query, please follow-up there,
Hide and show panels | Blazor Forums | Syncfusion
We are marking this as solved.
Regards,
Shereen