Skip to main content
All docs
V18.2

ASPxClientDashboard.SetDashboardState(String) Method

Applies the dashboard state to the loaded dashboard.

Namespace: DevExpress.DashboardWeb.Scripts

Assembly: DevExpress.Dashboard.v18.2.Web.WebForms.Scripts.dll

Declaration

public void SetDashboardState(
    string dashboardStateString
)

Parameters

Name Type Description
dashboardStateString String

A string value that specifies the state of the dashboard displayed in the ASPxClientDashboard.

Remarks

The DashboardState class includes states of individual dashboard items (the DashboardState.Items property) and currently selected parameter values (DashboardState.Parameters).

The following examples demostrates how to pass a string that contains a dashboard state.

  1. Set (xref:117060)[master-filter] values for the Grid and Card dashboard items:
var state = '{"Items":{"gridItem1":{"MasterFilterValues":[[2018]]},"cardItem1":{"MasterFilterValues":[["Manufacturing"]]}}}';
clientDashboard1.SetDashboardState(state);
  1. Set a drill-down value for the Chart dashboard item:
var state = '{"Items":{"chartItem1":{"DrillDownValues":["Web Forms"]}}}';
clientDashboard1.SetDashboardState(state);
  1. Set a dashboard parameter value and a master-filter value for the Card dashboard item:
var state = '{"Parameters":{"Year":2017},"Items":{"card1":{"MasterFilterValues":[["Petroleum Products"]]}}}';
clientDashboard1.SetDashboardState(state);
  1. Specify a tab page:
var state = '{"Items":{"tabContainerDashboardItem1":{"TabPageName":"pageDashboardItem2"}}}';
clientDashboard1.SetDashboardState(state);

To learn more about a dashboard state, see Manage Dashboard State.

See Also