Create and Load a Dashboard
- 2 minutes to read
You can display an existing dashboard or use the Dashboard Designer in Visual Studio to create a new dashboard. To do this, click the control’s smart tag and select the Set Dashboard Source command.
Next, select one of the following commands in the invoked menu:
Create New Dashboard
Clicking the Create New Dashboard menu item invokes the Dashboard Designer.
Here you can create a new dashboard or load an existing dashboard from an XML file. See Create Dashboards in the Visual Studio Designer for more information.
After you have created a dashboard, the DashboardControl initializes the DashboardControl.DashboardSource property as follows:
<dxdash:DashboardControl DashboardSource="{x:Type local:Dashboard1}"/>
Load from XML
The Load from XML command allows you to load an existing dashboard XML file. For instance, you can load a dashboard created in the WinForms Dashboard Designer.
The code sample below demonstrates how to load a dashboard from an XML file:
<dxdash:DashboardControl DashboardSource="C:\Temp\Dashboard.xml"/>
You can also specify a relative path to a dashboard file placed in the current project…
<dxdash:DashboardControl DashboardSource="..\..\Dashboard.xml"/>
… or use pack URI:
<dxdash:DashboardControl DashboardSource="pack://application:,,,/Dashboard.xml"/>
API Members
API | Description |
---|---|
DashboardControl.DashboardSource | Gets or sets a dashboard source for the DashboardControl. |
DashboardControl.LoadDashboard | Loads a dashboard from an XML file. |
DashboardControl.Dashboard | Gets or sets the opened dashboard. |
DashboardControl.DashboardLoaded | Occurs after the DashboardControl loads a dashboard. |