We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to create dynamic content


Please see the attached simplified project as reference. I'm trying to create dynamic content via the ContentTemplate element. The user should be able to select (via e.g. a listbox) what content panels to display in the dashboardlayout object and thus the panels that needs to be created are not known at initial rendering. When the user chooses a particular object to render in a new panel, the AddPanel method should be called and the ContentTemplate property should be set to a RenderFragment. Currently this is not working and I'm unsure how to approach this solution? This approach only works when I explicitly create the DashboardLayoutPanel element via html and then set the ContentTemplate property, but like I've mentioned before, the panels that needs to be created is not known before initial rendering and can therefore not be created explicitly in html. What would be the best approach to add panels and their respective content dynamically?

Thanks in advance for your assistance. 


Attachment: BlazorApp_AddPanel_Dynamic_2b659e27.zip

2 Replies

SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team January 20, 2020 06:48 AM UTC

Hi Ruan, 
Greetings from Syncfusion support. 
We have checked your reported query for render fragment support in addPanel() method. We have already completed the implementation of this support in Dashboard Layout component, and it is now in the testing phase.  This fix will be included in our Volume 4 SP1 Release, which is expected to be released at the end of January. 
You can track the status of this issue through the below portal link. 
We appreciate your patience until, then. 
Shameer Ali Baig S. 

SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team January 31, 2020 05:57 AM UTC

We are glad to announce that our Essential Studio 2019 Volume 4 Service Pack release v17.4.0.46 is rolled out and is available for download under the following link. 
In this release, we have included a support for “Dynamic add panel support for Dashboard Layout component”. 
For your reference, we have prepared a simple sample. Refer the sample link below. 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
Shameer Ali Baig S. 

Live Chat Icon For mobile
Up arrow icon