Skip to main content

DashboardControl.DashboardLoaded Event

Occurs after the DashboardControl loads a dashboard.

Namespace: DevExpress.DashboardWpf

Assembly: DevExpress.Dashboard.v24.1.Wpf.dll

NuGet Package: DevExpress.Wpf.Dashboard

Declaration

public event DashboardLoadedEventHandler DashboardLoaded

Event Data

The DashboardLoaded event's data class is DashboardLoadedEventArgs. The following properties provide information specific to this event:

Property Description
Dashboard A dashboard to load.

Remarks

The DashboardLoaded event is raised when the DashboardControl loads a dashboard from XML definition file. It happens when calling the DashboardControl.LoadDashboard method or assigning the file path or resource pack URI to the DashboardControl.DashboardSource property.

The event occurs after the Dashboard object is created and before it is assigned to the DashboardControl.Dashboard property.

Note

This event does not occur when a dashboard object model or dashboard class instance is assigned using the DashboardControl.Dashboard or DashboardControl.DashboardSourceproperty in XAML or in code.

Use the DashboardLoadedEventArgs.Dashboard event parameter to modify the dashboard before the DashboardControl displays it.

Handle this event to change the data source for the loaded dashboard, as illustrated in the following code snippet.

 private void DashboardControl_DashboardLoaded(object sender, DevExpress.DashboardWpf.DashboardLoadedEventArgs e)
{
    var excelDataSource = e.Dashboard.DataSources.
      FindFirst(i => i.ComponentName == "dashboardExcelDataSource1") as DashboardExcelDataSource;
    if (excelDataSource != null)
    {
        excelDataSource.FileName = dashboardExcelDataFileName;
        ExcelWorksheetSettings worksheetSettings = new ExcelWorksheetSettings("Bike Data");
        excelDataSource.SourceOptions = new ExcelSourceOptions(worksheetSettings);
        excelDataSource.Fill();
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DashboardLoaded event.

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.

See Also