Hi
Shawn,
We have
reviewed your query and understand that you are looking to render the non-razor
components inside the Dashboard Layout component ContentTemplate property. To
achieve this, we have used a RenderFragment type to render the content
dynamically within the ContentTemplate property.
Refer to
the below code snippet for further reference.
|
[Index.razor]
<SfDashboardLayout CellSpacing="@(new double[]{20 ,20 })" Columns="5" MediaQuery="max-width:700px">
<DashboardLayoutPanels>
<DashboardLayoutPanel>
<ContentTemplate>
@RenderFragmentContent
</ContentTemplate>
</DashboardLayoutPanel>
....
</DashboardLayoutPanels>
</SfDashboardLayout>
@code{
RenderFragment RenderFragmentContent => builder =>
{
builder.OpenComponent(0, typeof(MyComponent));
builder.AddAttribute(1, "Message", "This is a dynamic component inside
DashboardLayout!");
builder.CloseComponent();
};
}
|
We have
attached sample for your reference.
Sample : Attached as zip folder.
Could
you please confirm if this approach meets your requirements for the DashboardLayout
component? If not, we would appreciate any additional details or examples of
the non-Razor components you are using. These details will help us to validate
the query further and provide you with a prompt solution.
Regards,
Suresh.
Attachment:
BlazorDashboardLayoutNonRazor_ce370a18.zip