Skip to main content
A newer version of this page is available. .

Manage Dashboard Parameters

  • 2 minutes to read

The DashboardControl provides a built-in Dashboard Parameters dialog which allows you to change dashboard parameter values. This dialog is created automatically depending on the parameter type and visibility settings.

Standard Parameter Editor

To invoke the Dashboard Parameters dialog in the DashboardControl, click the Parameters button (the WPF) icon) in the dashboard title.

Dashboard_Parameters_Dialog_WPF)

Select the required parameter values in the Dashboard Parameters dialog and click the Submit button to apply the changes. To reset changes to the default values, click the Reset button.

The ShowParametersButton property enables you to show or hide the Parameters button.

Change Parameter Values in Code

You can call the DashboardControl.CustomParameters event to change dashboard parameter values in the DashboardControl at runtime. For instance, you can forcibly change a parameter value when an end user changes this value in the Dashboard Parameters dialog.

Manage Parameters in the Dashboard State

A dashboard state allows you to set parameters values. The DashboardState.Parameters property provides access to dashboard parameters.

The following code snippet illustrates how to manage the dashboard state to save and restore selected master filter values.

        public MainWindow() {
            InitializeComponent();
            DashboardState state1 = CreateDashboardState();
            dashboardControl.SetDashboardState(state1);
        }
        ...
        public DashboardState CreateDashboardState() {
            DashboardState state = new DashboardState();
            DashboardParameterState parameterState = new DashboardParameterState() {
                Name = "CategoryNameParameter",
                Type = typeof(string),
                Value = "Beverages"
            };
            state.Parameters.Add(parameterState);
            return state;
        }

        private void DashboardControl_SetInitialDashboardState(object sender, DevExpress.DashboardWpf.SetInitialDashboardStateWpfEventArgs e) {
            e.InitialState = CreateDashboardState();
        }
    }
}

See Manage the Dashboard State for more information.