Skip to main content

Load a Dashboard in ASP.NET Core

  • 2 minutes to read

Load a Dashboard on the Server

Dashboard storage is a location of dashboards you use in your Web Dashboard application. Users can save new dashboards to this storage and open existing dashboards. You can use the following API to manage dashboards in dashboard storage:

DashboardBuilder.InitialDashboardId
Specifies the identifier of the dashboard to be loaded to the Web Dashboard.
DashboardBuilder.LoadDefaultDashboard
Specifies whether the default dashboard should be loaded from the dashboard storage.

The DashboardInMemoryStorage and DashboardFileStorage classes implement the IDashboardStorage interface. Cast a corresponding object to IDashboardStorage and use IDashboardStorage.GetAvailableDashboardsInfo to obtain available dashboard identifiers.

The code snippet shows how to specify the SalesDetails dashboard as a default when you configure the control.

<div style="position: absolute; left:0;top:0;right:0;bottom:0;">
    @(Html.DevExpress().Dashboard("clientDashboardDesigner1")
        .ControllerName("DefaultDashboard)
        .Width("100%")
        .Height("100%")
        .InitialDashboardId("SalesDetails")
    )
</div>

Load a Dashboard on the Client

DashboardControl.loadDashboard
Use this method to load a dashboard with the specified identifier from the dashboard storage.
DashboardControl.unloadDashboard
Call this method to close the displayed dashboard.
DashboardControlOptions.initialDashboardId
Use this property to specify the identifier of the dashboard to be loaded to the DashboardControl before the control is rendered.

The following code snippet demonstrates how to load a dashboard with the dashboard1 identifier on the client:

dashboardControl.loadDashboard("dashboard1")
    .done(function () { alert("A dashboard is loaded successfully."); })
    .fail(function() { alert("Cannot load a dashboard."); });