Dashboard size not fitting page

Hi Syncfusion team,

I am implementing a dashboard, the layout of my application is a SfAppBar on top and a dockable SfSidebar on the left. When the application is first loaded it starts with the dashboard. However, the size of it is not fitting the page, it is wider than it (see picture 1). If I expand the dock, it is not adjusting its size, it is just moving to the right (see picture 2). If I navigate to another page (same layout) and go back to the dashboard, the dashboard displays properly (see picture 3). If then I expand the sidebar, it is shifted again to the right (see picture 4). If I go again to a page with the expanded sidebar and get back, it fits the page (see picture 5). If I collapse the sidebar, again is not adjusted (see picture 6).

What could explain this behavior?

Thanks.

Cristobal.

Picture 1:

Image_7468_1691578433362

Picture 2:

Image_5712_1691578469745

Picture 3:

Image_8278_1691578512668

Picture 4:

Image_6814_1691578541205

Picture 5:

Image_4790_1691578587866

Picture 6:

Image_1306_1691578619711


2 Replies

CR Cristobal August 9, 2023 10:58 AM UTC

Picture 6 seems to be broken. Here it is again:

Image_9298_1691578725721



LD LeoLavanya Dhanaraj Syncfusion Team June 27, 2024 04:37 AM UTC

Hi Cristobal,


Greetings from Syncfusion support.


Based on the details you shared, we understand that you are experiencing an issue with the Blazor Dashboard Layout component refreshment when rendering inside the Sidebar component.


So, we have created a Dashboard sample that is similar to your panel rendering code and found that the issue is caused by the Dashboard component's available space not being compatible with the Sidebar component. Additionally, the Dashboard component is not being properly refreshed when the Sidebar is closed/ opened and page reloaded. To resolve this issue, we suggest that you use the Dashboard RefreshAsync method to refresh the Dashboard within the Sidebar Changed and Created events.


Check out the below mentioned code snippets for further assistance.


<SfSidebar @ref="sidebarObj" Width="220px" DockSize="72px" EnableDock=true @bind-IsOpen="SidebarToggle" Created="created" Changed="changed">

</SfSidebar>

 

@*main content declaration*@

<div id="main-content container-fluid col-md-12">

    <div style="margin:10px 0 10px 10px;">

        <SfDashboardLayout @ref="DashboardObj">

            <DashboardLayoutPanels>

                <DashboardLayoutPanel>

                </DashboardLayoutPanel>

            </DashboardLayoutPanels>

        </SfDashboardLayout>

    </div>

</div>

    

@code {

    SfDashboardLayout DashboardObj;

    public async Task created()

    {

        await Task.Delay(500);

        await DashboardObj.RefreshAsync();

    }  

 

    public async Task changed()

    {

        await DashboardObj.RefreshAsync();

    }

}


Please get back to us if you need any further assistance.


Regards,

Leo Lavanya Dhanaraj


Attachment: SidebarWithDashboard_5405936f.zip

Loader.
Up arrow icon