Skip to main content

DashboardTypeStorage.RegisterDashboard(Type, String) Method

Adds a new dashboard to the current DashboardTypeStorage.

Namespace: DevExpress.DashboardWeb

Assembly: DevExpress.Dashboard.v23.2.Web.dll

NuGet Package: DevExpress.Web.Dashboard.Common

Declaration

public void RegisterDashboard(
    Type dashboardType,
    string dashboardName
)

Parameters

Name Type Description
dashboardType Type

A Type object that specifies the dashboard type.

dashboardName String

A String value that specifies the dashboard name.

Remarks

When you register a dashboard in the storage, the dashboard id is created as a hyphenated name generated from the namespace and class that specifies the dashboard type. If you want to set a custom name, use the RegisterDashboard(System.Type,System.String,System.String) overload with the dashboardId parameter.

Example

The following code snippet shows how to create a DashboardTypeStorage, add two dashboards created at design time to this storage, and load a dashboard with the ‘Dashboard2’ type from this storage.

The dashboard id passed to the DashboardId property is a hyphenated name generated from the namespace and class that specifies the dashboard type.

using DevExpress.DashboardWeb;
// ...
namespace AspNetWebFormsDashboardTest {
    public partial class Default : System.Web.UI.Page {
        protected void Page_Load(object sender, EventArgs e)
        {
            ASPxDashboard1.WorkingMode = WorkingMode.ViewerOnly;
            DashboardTypeStorage typeStorage = new DashboardTypeStorage();
            typeStorage.RegisterDashboard(typeof(Dashboard1));
            typeStorage.RegisterDashboard(typeof(Dashboard2));
            ASPxDashboard1.SetDashboardStorage(typeStorage);
            ASPxDashboard1.DashboardId = "AspNetWebFormsDashboardTest-Dashboard2";
        }
    }
}
See Also