DashboardViewer.CustomParameters Event

Occurs before data is loaded from the data store and allows you to customize dashboard parameters that are used for data processing.

Namespace: DevExpress.DashboardWin

Assembly: DevExpress.Dashboard.v18.2.Win.dll

Declaration

public event CustomParametersEventHandler CustomParameters
Public Event CustomParameters As CustomParametersEventHandler

The CustomParameters event handler receives an argument of the CustomParametersEventArgs type. The following properties provide information specific to this event.

Property Description
Parameters Gets or sets dashboard parameters.

The CustomParameters event provides access to a collection of dashboard parameters (CustomParametersEventArgs.Parameters) and allows you to change actual parameter values, parameter settings or even add new parameters. Note that parameter values specified in the CustomParameters event handler are used only for data processing and are not displayed in the Dashboard Parameters dialog.

Note

To learn how to specify default parameter values by handling the DashboardViewer.DashboardLoaded event, see the following example: How to: Specify Default Parameter Values in the WinForms Viewer.

Examples

The following example shows how to filter a custom SQL query by changing a parameter value in the DashboardViewer.CustomParameters event handler.

In this example, the custIDQueryParameter query parameter is included in a WHERE clause of a custom SQL query. The custIDQueryParameter parameter is also bound to the hidden custIDDashboardParameter dashboard parameter. The value of this parameter is changed at runtime by handling the DashboardViewer.CustomParameters event which is raised before the DashboardViewer sends a query to a database.

using DevExpress.DashboardCommon;
using System.Linq;

namespace Dashboard_CustomParameters_Win {
    public partial class Form1 : DevExpress.XtraEditors.XtraForm {
        public Form1() {
            InitializeComponent();

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

        private void dashboardViewer1_CustomParameters(object sender, CustomParametersEventArgs e) {
            var custIDParameter = e.Parameters.FirstOrDefault(p => p.Name == "custIDDashboardParameter");
            if (custIDParameter != null) {
                custIDParameter.Value = "AROUT";
            }
        }
    }
}
See Also