Skip to main content

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.v22.1.Win.dll

Declaration

public event CustomParametersEventHandler CustomParameters

Event Data

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

Property Description
Parameters Gets or sets dashboard parameters.

Remarks

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.

For information on how to use the DashboardViewer.DashboardLoaded event to specify default parameter values, see the following example:

View Example: How to Specify Default Parameter Values in the WinForms Viewer

Example

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.

View Example

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";
            }
        }
    }
}

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