Manage Dashboard Parameters

The DashboardViewer provides a built-in Dashboard Parameters dialog, providing the capability 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 DashboardViewer, click the Parameters button (the Parameters_ParametersButtonWin_Title icon) in the dashboard title.

Parameters_DashboardParametersDialog_Win

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.

To invoke this dialog in code, use the DashboardViewer.ShowDashboardParametersForm method.

Changing Parameter Values in Code

You can change dashboard parameter values in the DashboardViewer using the DashboardViewer.Parameters property.

The DashboardParameterDescriptor class objects returned by the DashboardViewer.Parameters property allow you to obtain parameter settings such as the parameter type (the DashboardParameterDescriptor.Type property), the default parameter value (the DashboardParameterDescriptor.DefaultValue property), the parameter name (the DashboardParameterDescriptor.Name property), etc.

The DashboardParameterDescriptor.Values property returns possible parameter values. Use the DashboardParameterDescriptor.Value property to obtain or specify the current parameter value. If you change multiple values, wrap the code in the DashboardViewer.BeginUpdateParameters and DashboardViewer.EndUpdateParameters method calls.

The code snippet below shows how to specify values of DateTime parameters using the DashboardViewer API.

dashboardViewer1.BeginUpdateParameters();
dashboardViewer1.Parameters["fromDate"].Value = new DateTime(2015, 4, 1);
dashboardViewer1.Parameters["toDate"].Value = new DateTime(2015, 10, 1);
dashboardViewer1.EndUpdateParameters();

The DashboardViewer also provides the DashboardViewer.CustomParameters event that allows you to change dashboard parameter values at runtime. For instance, you can forcibly change a parameter value when an end-user changes this value in the Dashboard Parameters dialog.

See Also