Skip to main content
All docs
V26.1
  • TdxCustomDashboardControl.Layout Property

    Provides access to the dashboard layout (in XML).

    Declaration

    property Layout: TStringList read;

    Property Value

    Type Description
    TStringList

    Stores the current dashboard layout (as XML strings).

    Remarks

    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.

    Design-Time Functionality

    The following design-time edit options are available for the Layout property value:

    Dashboard Designer

    A double-click on a TdxDashboardControl component on a form displays the Web Dashboard dialog for the component (in Designer Mode).

    VCL Dashboards: A Dashboard Designer Dialog Example

    Note

    If a dashboard UI/layout is defined at design time, the Layout property stores the XML layout in a DFM project file.

    Available Options

    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.

    End-User Layout Edit Functionality

    Call the ShowDesigner procedure to display the Web-Based [Dashboard Designer] dialog.

    VCL Dashboards: A Dashboard Designer Dialog Example

    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.

    Dashboard User Interaction States

    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.

    Code Examples

    Save Dashboard Layout to File on Every Change

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

    uses
      dxDashboard.Control;  // Declares the TdxDashboardControl class
    // ...
    
    procedure TMyForm.dxDashboardControl1LayoutChanged(ASender: TdxCustomDashboardControl);
    begin
      ASender.Layout.SaveToFile(ASender.DashboardName + '.xml');
    end;
    

    View Example: Store Dashboard Layouts in a Database

    Footnotes
    1. The OnLayoutChanged event occurs on every Layout property value change.

    See Also