DashboardTypeStorage.RegisterDashboard(Type, String, String) Method
Adds a new dashboard to the current DashboardTypeStorage.
Namespace: DevExpress.DashboardWeb
Assembly: DevExpress.Dashboard.v24.1.Web.dll
NuGet Package: DevExpress.Web.Dashboard.Common
Declaration
public void RegisterDashboard(
Type dashboardType,
string dashboardName,
string dashboardId
)
Parameters
Name | Type | Description |
---|---|---|
dashboardType | Type | A Type object that specifies the dashboard type. |
dashboardName | String | A String value that specifies the dashboard name. |
dashboardId | String | A String value that specifies the dashboard identifier. |
Remarks
Use this overload to specify a custom dashboard ID. When you register a dashboard in the storage with other overloads, the dashboard ID is created as a hyphenated name generated from the namespace and class that specifies the dashboard type.
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";
}
}
}