Back to Devexpress

TdxCustomDashboardControl.OnLayoutChanged Event

vcl-dxdashboard-dot-control-dot-tdxcustomdashboardcontrol-090eb8f5.md

latest2.2 KB
Original Source

TdxCustomDashboardControl.OnLayoutChanged Event

Allows you to save dashboard layout changes made in the Dashboard Designer dialog.

Declaration

delphi
property OnLayoutChanged: TdxDashboardControlNotifyEvent read; write;

Remarks

Handle the OnLayoutChanged event to execute custom code in response to dashboard layout updates.

Event Occurrence

The OnLayoutChanged event occurs in response to every Layout property value change.

Event Parameter

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

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

See Also

TdxCustomDashboardControl.OnStateChanged Event

TdxCustomDashboardControl Class

TdxCustomDashboardControl Members

dxDashboard.Control Unit