The requested page is not available for the requested platform. You are viewing the content for Default platform.

How to: Specify Dashboard Parameter Values on the Client Side in the Web Viewer

Important

This documentation applies to v16.2. Starting with v17.1, the ASPxDashboardViewer control is in maintenance mode. In v19.1, the new Web Dashboard Control replaces the old Web Dashboard Viewer. This means that the Web Dashboard Viewer will not be included in our installation packages. See our blog post for more information.

Refer to the following KB articles to learn how to migrate to ASPxDashboard / ASP.NET MVC Dashboard:

This example demonstrates how to change dashboard parameter values in the Web Viewer on the client side using the ASPxClientDashboardViewer.GetParameters method.

In this example, current parameter values are specified between the ASPxClientDashboardViewer.BeginUpdateParameters and ASPxClientDashboardViewer.EndUpdateParameters method calls using the ASPxClientDashboardParameter.SetValue method.

function specifyParameterValues() {
    var specifyValues = function () {
        var parameters = webViewer.GetParameters();
        var parameter1 = parameters.GetParameterByName("category1");
        var parameter2 = parameters.GetParameterByName("startDate1");
        webViewer.BeginUpdateParameters();
        parameter1.SetValue(parameter1.GetValues()[1].GetValue());
        parameter2.SetValue(new Date(1995, 3, 1));
        webViewer.EndUpdateParameters();
    };

    $("#buttonContainer").dxButton({
        clickAction: specifyValues,
        text: "Specify parameter values"
    });
};
See Also