Skip to main content

DashboardViewer.DashboardLoaded Event

Occurs after the dashboard is loaded to the DashboardViewer.

Namespace: DevExpress.DashboardWin

Assembly: DevExpress.Dashboard.v22.1.Win.dll

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 Gets the loaded dashboard.

Remarks

The DashboardLoaded event is raised whenever a dashboard is loaded to the DashboardViewer.

Use the DashboardLoadedEventArgs.Dashboard event parameter to customize the dashboard before it is loaded to the DashboardViewer.

Example

The following example shows how to specify default parameter values when a dashboard is loading. To do this, handle the DashboardViewer.SetInitialDashboardState event. Create a DashboardParameterState instance and use its Name and Value properties to configure parameter values. Create a DashboardState object and add the specified dashboard parameter to the DashboardState.Parameters collection. Assign the created DashboardState object to the SetInitialDashboardStateBaseEventArgs.InitialState property to apply specified parameter values when a dashboard is loading.

View Example

using System.Collections.Generic;
using DevExpress.DashboardCommon;
using DevExpress.DashboardWin;
using DevExpress.DataAccess.ConnectionParameters;

namespace WinViewer_DefaultParameterValues {
    public partial class Form1 : DevExpress.XtraEditors.XtraForm {
        public Form1() {
            InitializeComponent();
        }
        private void dashboardViewer1_SetInitialDashboardState(object sender, SetInitialDashboardStateEventArgs e) {
            DashboardState state = new DashboardState();
            DashboardParameterState parameters = new DashboardParameterState();
            parameters.Name = "customerIdParameter";
            parameters.Value = new List<string>() { "ALFKI", "AROUT", "BONAP" };
            state.Parameters.Add(parameters);
            e.InitialState = state;
        }
        private void dashboardViewer1_ConfigureDataConnection(object sender, DashboardConfigureDataConnectionEventArgs e) {
            if (e.DataSourceName == "SQL Data Source 1")
                e.ConnectionParameters = new Access97ConnectionParameters(@"..\..\Data\nwind.mdb", "", "");
        }
    }
}

The following code snippets (auto-collected from DevExpress Examples) contain references 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.

Implements

See Also