Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CPB/uMainForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ void __fastcall TMainForm::LoadLayoutAndState()

if (!DataModule1->mdLayoutsState->IsNull)
dxDashboardControl1->State->Assign(DataModule1->mdLayoutsState);

dxDashboardControl1->Active = true;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::btnDeleteClick(TObject *Sender)
Expand Down Expand Up @@ -123,13 +125,14 @@ void __fastcall TMainForm::gvLayoutsFocusedRecordChanged(
(DataModule1->mdLayouts->State != dsInsert))
{
LoadLayoutAndState();
}
}
}
//---------------------------------------------------------------------------

void __fastcall TMainForm::dxDashboardControl1LayoutChanged(
TdxCustomDashboardControl *ASender)
{
dxDashboardControl1->Active = true;
if (DataModule1->mdLayoutsName->AsString != dxDashboardControl1->DashboardName)
{
DataModule1->mdLayouts->Append();
Expand Down
1 change: 0 additions & 1 deletion CPB/uMainForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class TMainForm : public TForm
TdxLayoutItem *liBtnNew;
TdxLayoutGroup *lgButtons;
TdxLayoutItem *liBtnDelete;
TcxGridDBColumn *gvLayoutsState;
void __fastcall btnNewDashboardClick(TObject *Sender);
void __fastcall btnDeleteClick(TObject *Sender);
void __fastcall btnDesignClick(TObject *Sender);
Expand Down
3 changes: 3 additions & 0 deletions Delphi/uMainForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ procedure TMainForm.LoadLayoutAndState;
dxDashboardControl1.Layout.Assign(DataModule1.mdLayoutsLayout);
if not DataModule1.mdLayoutsState.IsNull then
dxDashboardControl1.State.Assign(DataModule1.mdLayoutsState);

dxDashboardControl1.Active := True;
end;

procedure TMainForm.btnDeleteClick(Sender: TObject);
Expand Down Expand Up @@ -131,6 +133,7 @@ procedure TMainForm.gvLayoutsFocusedRecordChanged(
procedure TMainForm.dxDashboardControl1LayoutChanged(
ASender: TdxCustomDashboardControl);
begin
dxDashboardControl1.Active := True;
if DataModule1.mdLayoutsName.AsString <> dxDashboardControl1.DashboardName then
begin
DataModule1.mdLayouts.Append;
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
1. Click the hamburger button, select the **Save** option, and close the dialog.
1. Create additional layouts if necessary.
1. Close and restart the app.
Click on grid records to switch between dashboard layouts you set up previously.
1. Click on grid records to switch between dashboard layouts you set up previously.
Click **Design Dashboard** or **Delete Dashboard** to modify or delete entries.

![DevExpress Dashboards for Delphi/C++Builder — Store Dashboard Layout Definitions in a Database](./images/vcl-dashboards-store-layout-template-database.gif)
Expand All @@ -39,7 +39,7 @@

The example stores dashboard layouts using a DevExpress memory-based dataset ([TdxMemData]).
You can modify the application to use any other [TDataSet] descendant instead.
To review our data module implementation, see the following file: [uData.pas]/[uData.cpp].

Check warning on line 42 in README.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.md#L42

[Microsoft.We] Only use we/us when you refer to our organization.
Raw output
{"message": "[Microsoft.We] Only use we/us when you refer to our organization.", "location": {"path": "README.md", "range": {"start": {"line": 42, "column": 11}}}, "severity": "WARNING"}

The instructions assume that you start with a Delphi or C++Builder project that already includes
a configured data source for DevExpress Dashboards.
Expand Down Expand Up @@ -113,6 +113,8 @@
// Load a dashboard state if it is stored in the database
if not DataModule1.mdLayoutsState.IsNull then
dxDashboardControl1.State.Assign(DataModule1.mdLayoutsState);
// Activate the dashboard control
dxDashboardControl1.Active := True;
end;
```
<!-- end-code-block -->
Expand All @@ -121,8 +123,18 @@
The assigned layout definition replaces the current definition and resets the dashboard state.

You can also clear the Dashboard Control using [TdxCustomDashboardControl.Clear].
The `Clear` function disables the `TdxCustomDashboardControl.Active` property.
Once you assign a new dashboard layout (and, optionally, a UI interaction state),
you must activate the dashboard control.


<!-- start-code-block -->
#### Delphi
```delphi
dxDashboardControl1.Active := True;
```
<!-- end-code-block -->

### Step 3: Display the Dashboard Designer

Once you assign a dashboard layout definition to the Dashboard Control,
Expand Down
Loading