vcl-dxdashboard-dot-control-dot-tdxcustomdashboardcontrol-562a94ff.md
Provides access to the dashboard layout (in XML).
property Layout: TStringList read;
| Type | Description |
|---|---|
| TStringList |
Stores the current dashboard layout (as XML strings).
|
A dashboard layout definition contains data visualization items, properties, data bindings, and general layout information. You can use the Layout property to load, save, and access the dashboard layout.
The following design-time edit options are available for the Layout property value:
A double-click on a TdxDashboardControl component on a form displays the Web Dashboard dialog for the component (in Designer Mode).
Click the ellipsis button to the right of the Layout property in the Object Inspector to display a text editor.
You can use this editor to paste an XML layout definition from a different source or edit the current dashboard layout directly.
Note
If a dashboard UI/layout definition is set/specified at design time, the Layout property stores the XML layout in a DFM project file.
Call Layout.LoadFromFile/Layout.LoadFromStream and Layout.SaveToFile/Layout.SaveToStream procedures to import and export configured dashboard layouts in the XML format.
In addition, you can use Layout.Strings and Layout.Text properties to access and modify dashboard layout content directly (if required).
Refer to the TStringList class description for detailed information on all available options.
Call the ShowDesigner procedure to display the Web-Based [Dashboard Designer] dialog.
All changes made in this dialog update the Layout property value and raise the OnLayoutChanged event[1]. For example, you can handle this event to save dashboard layout changes to a file or stream.
Tip
Refer to the following topic for detailed information on all tools available for dashboard layout creation: Create Dashboards on the Web.
The State property provides access to the dashboard/user interaction state that includes filter criteria, drill-down values, the active tab page, dashboard parameter values, individual data visualization item states, and other configuration options set by users.
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:
uses
dxDashboard.Control; // Declares the TdxDashboardControl component
// ...
procedure TMyForm.dxDashboardControl1LayoutChanged(ASender: TdxCustomDashboardControl);
begin
ASender.Layout.SaveToFile(ASender.DashboardName + '.xml');
end;
#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");
}
View Example: Store Dashboard Layouts in a Database
Footnotes
Layout property value change.See Also
TdxCustomDashboardControl.Clear Procedure
TdxCustomDashboardControl Class