Back to Devexpress

DashboardViewer.LoadDashboard(String) Method

dashboard-devexpress-dot-dashboardwin-dot-dashboardviewer-dot-loaddashboard-x28-system-dot-string-x29.md

latest7.9 KB
Original Source

DashboardViewer.LoadDashboard(String) Method

SECURITY-RELATED CONSIDERATIONS

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

Declaration

csharp
public void LoadDashboard(
    string filePath
)
vb
Public Sub LoadDashboard(
    filePath As String
)

Parameters

NameTypeDescription
filePathString

A String that specifies the path to an XML file that contains the dashboard.

|

Remarks

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:

csharp
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.

winforms-dashboard-replace-sql-data-source-with-object-data-source-with-filtered-data/CS/WinFormsDashboard/ViewerForm.cs#L23

csharp
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

csharp
InitializeComponent();
    dashboardViewer1.LoadDashboard(@"..\..\Data\Dashboard.xml");
}

winforms-dashboard-filter-sql-query-at-runtime/CS/Dashboard_CustomFilterExpression_Win/Form1.cs#L8

csharp
InitializeComponent();
    dashboardViewer1.LoadDashboard(@"..\..\Data\Dashboard.xml");
}

winforms-dashboard-pass-hidden-dashboard-parameters-to-custom-sql-query/CS/Dashboard_CustomParameters_Win/Form1.cs#L8

csharp
InitializeComponent();
    dashboardViewer1.LoadDashboard(@"..\..\Data\Dashboard.xml");
}

winforms-dashboard-add-custom-interactivity-to-dashboard/CS/Dashboard_CustomVisualInteractivity/Form1.cs#L20

csharp
dashboardViewer1.LoadDashboard("Data\\Dashboard.xml");
}

winforms-dashboard-replace-sql-data-source-with-object-data-source-with-filtered-data/VB/WinFormsDashboard/ViewerForm.vb#L25

vb
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

vb
InitializeComponent()
    dashboardViewer1.LoadDashboard("..\..\Data\Dashboard.xml")
End Sub

winforms-dashboard-filter-sql-query-at-runtime/VB/Dashboard_CustomFilterExpression_Win/Form1.vb#L10

vb
InitializeComponent()
    dashboardViewer1.LoadDashboard("..\..\Data\Dashboard.xml")
End Sub

winforms-dashboard-pass-hidden-dashboard-parameters-to-custom-sql-query/VB/Dashboard_CustomParameters_Win/Form1.vb#L10

vb
InitializeComponent()
    dashboardViewer1.LoadDashboard("..\..\Data\Dashboard.xml")
End Sub

winforms-dashboard-add-custom-interactivity-to-dashboard/VB/Dashboard_CustomVisualInteractivity/Form1.vb#L21

vb
dashboardViewer1.LoadDashboard("Data\Dashboard.xml")
End Sub

Implements

LoadDashboard(String)

See Also

Save a Dashboard in the WinForms Designer

DashboardViewer Class

DashboardViewer Members

DevExpress.DashboardWin Namespace