Dashboard layout panels do not persist

I copied the sample code from the documentation of SfDashboardLayout and enabled the persistence like:

 <SfDashboardLayout Columns="6" CellSpacing="@(new double[]{10 ,10 })" EnablePersistence=true>.


However, after moving panels around and then reloading the page or logging in and out, the panels are layout in the the default position, not in the positions that were at the time of leaving the page.  

Do I need to do anything else in addition to adding   EnablePersistence=true?

Thanks

Harshad


3 Replies

PM Prasanth Madhaiyan Syncfusion Team March 1, 2024 07:36 AM UTC

Hi Harshad,


Greetings from Syncfusion support.


Yes, when you utilize the EnablePersistence property, you additionally need to set the ID for the Blazor Dashboard Layout component. Because the data will be persisted based on the component ID, for persistence, it is mandatory to provide an ID. However, the EnablePersistence property persists the component's state between page reloads.


Refer to the below code snippets.


[Index.razor]


<SfDashboardLayout ID="dashboard" CellSpacing="@(new double[]{10 ,10 })" Columns="6" EnablePersistence=true>

    <DashboardLayoutPanels>

       

    </DashboardLayoutPanels>

</SfDashboardLayout>


For your reference, we have attached the sample.


Sample: Attached as a zip file.


Check out the attached sample and let us know if you need any further assistance.


Regards,

Prasanth Madhaiyan.


Attachment: BlazorDashboard_6ddbe321.zip


HA Harshad March 1, 2024 06:41 PM UTC

Hi Prashanth,


Perfect!  That works as expected. Thank you very much!

Regards

Harshad



PM Prasanth Madhaiyan Syncfusion Team March 4, 2024 04:49 AM UTC

Hi Harshad,


Thank you for the update. Please get back to us for assistance in the future.


Regards,

Prasanth Madhaiyan.


Loader.
Up arrow icon