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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

4 equally sized DashboardLayoutPanel with responsive properties inside Dashboard

Thread ID:

Created:

Updated:

Platform:

Replies:

149567 Nov 30,2019 12:41 PM UTC Dec 4,2019 05:23 AM UTC Blazor 5
loading
Tags: Dashboard Layout
Junaid
Asked On November 30, 2019 12:41 PM UTC

Good day,

I have four panels inside the dashboard layout. I want them to be equally sized and spaced and not overlapping each other. I want two rows two panels in each row. 

Like this:
Panel1Panel2
Panel3Panel4

Issue:



Panel2 is under panel 4. Chart in panel3 and grid in panel4 are extending outside of their respective panels. I am seeing the vertical scroll bar which tells that these are not fitting the screen height. Kindly help.

This is what I have tried so far:

    <EjsDashboardLayout ID="dashboard" CellSpacing="@(new double[]{10, 10})" Columns="4" AllowDragging="false">
            <DashboardLayoutPanel Id="Panel1" Col=0 Row=1 SizeX=2 SizeY=1.3>
            <DashboardLayoutPanel Id="Panel2" SizeX=2 SizeY=1.3 Col=3 Row=1>
            <DashboardLayoutPanel Id="Panel3" Col=0 Row=2 SizeX=2 SizeY=1.5>
            <DashboardLayoutPanel Id="Panel4" SizeX=2 SizeY=1.5 Col=3 Row=2>

What settings do I use? As I want the enitre panel to be responsive and not extend the screen size in horizontal or vertical direction?

Thanks.
Junaid


Kanagambigai Murugan [Syncfusion]
Replied On December 2, 2019 12:49 PM UTC

Hi Junaid, 

Good day to you. 

We have validated your reported issue. To overcome this issue, you need to call the refresh method of chart/grid component in the dashboard layout’s created event if you are using content template to render the component. Also you need to set the width and height of the component as 100% to overcome the reported issues. Please refer to the following code snippet. 

<EjsDashboardLayout CellSpacing="@(new double[]{20 ,20 })" Columns="4" CellAspectRatio="2"> 
        <DashboardLayoutEvents Created="@onCreate"></DashboardLayoutEvents> 
        <DashboardLayoutPanels> 
            <DashboardLayoutPanel Row="0" Col="0" SizeX="2" SizeY="2"> 
                <ContentTemplate> 
                    <div style="width:100%;height:100%"> 
                        <EjsAccumulationChart ID="pie" Height="100%" Width="100%" @ref="chartObj"> 
                            <AccumulationChartSeriesCollection> 
                                <AccumulationChartSeries DataSource="@MedalDetails" XName="Country" YName="Medals"> 
                                </AccumulationChartSeries> 
                            </AccumulationChartSeriesCollection> 
                        </EjsAccumulationChart> 
                    </div> 
                </ContentTemplate> 
            </DashboardLayoutPanel> 
 
   public async Task onCreate(object args)  
    { 
        await Task.Delay(1000); // simulate the async operations 
        this.chartObj.Refresh(); 
        this.barchartObj.Refresh(); 
        this.GridObj1.Refresh(); 
        this.GridObj2.Refresh(); 
       
    } 

The vertical scroll bar appears due to the customization in application level. Please refer to following screenshot. 

 
 

Kindly check the above sample and get back to us if you need further assistance on this. 

Regards, 
Kanagambigai M. 


Junaid
Replied On December 2, 2019 02:38 PM UTC

Good day,

Thanks.. that solved my problem. 

In one of your tutorials on Dashboards, I have seen the usage of :

    protected override async Task OnAfterRenderAsync(bool firstRender){.....}

.. for doing the same thing you did by using OnCreate..

How are both of these methods different? Which one is better to use?

Regards.
Junaid


Sowmiya Padmanaban [Syncfusion]
Replied On December 3, 2019 01:45 PM UTC

Hi Junaid, 
 
Thanks for contacting Syncfusion support. 
 
We would like to let you know that created event will be triggered once the dashboard layout component is rendered, whereas OnAfterRenderAsync will be invoked only after the blazor component has been completely rendered (eg: home component). If you are only using only the Dashboard layout in your page, then you can make use of the created event of the Dashboard layout component itself. Else if you make any manipulations while assigning chart or grid component data then you can make use of onAfterRenderAsync to refresh the panel content components at your end. 
 
 
Please let us know, if you have any concerns. 
 
Regards, 
Sowmiya.P 


Junaid
Replied On December 3, 2019 02:19 PM UTC

Goo day,

Thank you so much. 

Regards.
Junaid

Sowmiya Padmanaban [Syncfusion]
Replied On December 4, 2019 05:23 AM UTC

Hi Junaid, 
  
Most welcome. We are glad to hear that the provided solution helped you to achieve your requirement. Please get back to us if you need any futher assistance on this. 
  
Regards, 
Sowmiya.P 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon