Back to Devexpress

TdxDashboardControlNotifyEvent Type

vcl-dxdashboard-dot-control-f960fdff.md

latest3.7 KB
Original Source

TdxDashboardControlNotifyEvent Type

The procedural type for general dashboard-related notification events.

Declaration

delphi
TdxDashboardControlNotifyEvent = procedure(ASender: TdxCustomDashboardControl) of object;

Parameters

NameTypeDescription
ASenderTdxCustomDashboardControl

Provides access to the dashboard control that raised the notification event.

Tip

You need to cast the parameter value to the TdxDashboardControl class to access all public API members.

|

Remarks

Handle dashboard-related notification events to execute custom code in response to certain changes in your ExpressDashboards-powered application.

Code Examples

Save Dashboard Layout to File on Every Change

The following code example saves the current dashboard layout to an XML file every time a user saves pending changes in the Dashboard Designer dialog:

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

procedure TMyForm.dxDashboardControl1LayoutChanged(ASender: TdxCustomDashboardControl);
begin
  ASender.Layout.SaveToFile(ASender.DashboardName + '.xml');
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::dxDashboardControl1LayoutChanged(TdxCustomDashboardControl *ASender)
{
  ASender->Layout->SaveToFile(ASender->DashboardName + ".xml");
}

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");
}

Direct TdxDashboardControlNotifyEvent Type References

The following events reference the TdxDashboardControlNotifyEvent procedural type:

TdxCustomDashboardControl.OnLayoutChangedAllows you to save dashboard layout changes made in the Dashboard Designer dialog.TdxCustomDashboardControl.OnStateChangedAllows you to save dashboard/user interaction state changes. See Also

TdxDashboardControlExportEvent Procedural Type

TdxReportNotifyEvent Procedural Type

dxDashboard.Control Unit