ASPxClientDashboard.DashboardStateChanged Event

Occurs after the state of the dashboard displayed in the ASPxClientDashboard is changed.

Namespace: DevExpress.DashboardWeb.Scripts

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

Declaration

public event ASPxClientDashboardStateChangedEventHandler DashboardStateChanged
Public Event DashboardStateChanged As ASPxClientDashboardStateChangedEventHandler

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

Examples

The sample illustrates how to save the current ASPxDashboard state (such as master filter or parameter values) to cookies on the client side and restore this state on the server side. The following API is used in this example:

using DevExpress.DashboardCommon;
using DevExpress.DashboardWeb;
using System;
using System.Web;

namespace WebDashboard_DashboardStateCookies
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {            
        }

        protected void ASPxDashboard1_SetInitialDashboardState(object sender, SetInitialDashboardStateEventArgs e)
        {
            HttpCookie cookie = Request.Cookies["ASPxDashboardState"];
            if (cookie != null)
            {
                DashboardState dashboardState = new DashboardState();
                dashboardState.LoadFromJson(HttpUtility.UrlDecode(cookie.Value));
                if (e.DashboardId == "dashboard1")
                    e.InitialState = dashboardState;
            }
        }
    }
}
See Also