Back to Devexpress

TdxCustomDashboardControl.OnStateChanged Event

vcl-dxdashboard-dot-control-dot-tdxcustomdashboardcontrol-48fc103c.md

latest2.1 KB
Original Source

TdxCustomDashboardControl.OnStateChanged Event

Allows you to save dashboard/user interaction state changes.

Declaration

delphi
property OnStateChanged: TdxDashboardControlNotifyEvent read; write;

Remarks

Handle the OnStateChanged event to execute custom code in response to dashboard state changes.

Event Occurrence

The OnStateChanged event occurs in response to every State property value change (for example, when users resize data visualization items, modify filter criteria, etc.).

Event Parameter

The ASender parameter provides access to the TdxDashboardControl component that raised the OnStateChanged event.

Code Example: Save Dashboard State to File in Response to User Changes

The following code example saves the current dashboard user interaction state to a JSON file on every change:

delphi
uses
  dxDashboard.Control; // Declares the TdxDashboardControl component
// ...

procedure TMyForm.dxDashboardControl1StateChanged(ASender: TdxCustomDashboardControl);
begin
  ASender.State.SaveToFile(ASender.DashboardName + 'State.json');
end;
cpp
#include "dxDashboard.Control.hpp" // Declares the TdxDashboardControl component

// Add the following linker directive to the corresponding CPP source file:
#pragma link "dxDashboard.Control" // Required to use dxDashboard.Control.hpp declarations
// ...

void __fastcall TMyForm::dxDashboardControl1StateChanged(TdxCustomDashboardControl *ASender)
{
  ASender->State->SaveToFile(ASender->DashboardName + "State.json");
}

See Also

TdxCustomDashboardControl.OnLayoutChanged Event

TdxCustomDashboardControl Class

TdxCustomDashboardControl Members

dxDashboard.Control Unit