dashboard-devexpress-dot-dashboardwin-dot-dashboardviewer-dot-loaddashboard-x28-system-dot-string-x29.md
Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.
Loads a dashboard from an XML file.
Namespace : DevExpress.DashboardWin
Assembly : DevExpress.Dashboard.v25.2.Win.dll
NuGet Package : DevExpress.Win.Dashboard
public void LoadDashboard(
string filePath
)
Public Sub LoadDashboard(
filePath As String
)
| Name | Type | Description |
|---|---|---|
| filePath | String |
A String that specifies the path to an XML file that contains the dashboard.
|
You can open a dashboard in one of the following ways.
All these actions raise the DashboardViewer.DashboardChanged event.
To access the dashboard after it has been opened, use the DashboardViewer.Dashboard property.
To save a dashboard to a file or a stream, use the Dashboard.SaveToXml method.
Note
If the DashboardDesigner / DashboardViewer control is placed in the MDI child form, load dashboards in the Shown event handler instead of Load.
The following code snippet shows how to load a dashboard located in the project’s Data folder:
dashboardViewer1.LoadDashboard("../../Data/dashboard1.xml");
The following code snippets (auto-collected from DevExpress Examples) contain references to the LoadDashboard(String) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
private void ViewerForm_Load(object sender, EventArgs e) {
dashboardViewer1.LoadDashboard("TestDashboard.xml");
}
winforms-dashboard-access-api-of-underlying-controls/CS/Dashboard_ControlAccess/Form1.cs#L12
InitializeComponent();
dashboardViewer1.LoadDashboard(@"..\..\Data\Dashboard.xml");
}
winforms-dashboard-filter-sql-query-at-runtime/CS/Dashboard_CustomFilterExpression_Win/Form1.cs#L8
InitializeComponent();
dashboardViewer1.LoadDashboard(@"..\..\Data\Dashboard.xml");
}
InitializeComponent();
dashboardViewer1.LoadDashboard(@"..\..\Data\Dashboard.xml");
}
dashboardViewer1.LoadDashboard("Data\\Dashboard.xml");
}
Private Sub ViewerForm_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
dashboardViewer1.LoadDashboard("TestDashboard.xml")
End Sub
winforms-dashboard-access-api-of-underlying-controls/VB/Dashboard_ControlAccess/Form1.vb#L14
InitializeComponent()
dashboardViewer1.LoadDashboard("..\..\Data\Dashboard.xml")
End Sub
winforms-dashboard-filter-sql-query-at-runtime/VB/Dashboard_CustomFilterExpression_Win/Form1.vb#L10
InitializeComponent()
dashboardViewer1.LoadDashboard("..\..\Data\Dashboard.xml")
End Sub
InitializeComponent()
dashboardViewer1.LoadDashboard("..\..\Data\Dashboard.xml")
End Sub
dashboardViewer1.LoadDashboard("Data\Dashboard.xml")
End Sub
See Also