The requested page is not available for the requested platform. You are viewing the content for Default platform.

DashboardControl.DashboardLoaded Event

Occurs after the DashboardControl loads a dashboard.

Namespace: DevExpress.DashboardWpf

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

Declaration

public event DashboardLoadedEventHandler DashboardLoaded
Public Event DashboardLoaded As DashboardLoadedEventHandler

Event Data

The DashboardLoaded event handler receives an argument of the DashboardLoadedEventArgs type. 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.

Note

The complete sample project How to Change the Dashboard Data Source Using the DashboardLoaded Event is available in the DevExpress Examples repository.

 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();
    }
}
See Also