Skip to content

Commit 5dfb7b6

Browse files
cpp-builder: Reactivate dashboard control when a new layout is set
`TdxDashboardControl.Clear` makes the control inactive, so that it does not show any content (TdxDashboardControl.Active == False). Remove an unused component declaration. Co-authored-by: Ilia Nenashev <ilia.nenashev@devexpress.com>
1 parent 3b42f95 commit 5dfb7b6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CPB/uMainForm.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ void __fastcall TMainForm::LoadLayoutAndState()
7474

7575
if (!DataModule1->mdLayoutsState->IsNull)
7676
dxDashboardControl1->State->Assign(DataModule1->mdLayoutsState);
77+
78+
dxDashboardControl1->Active = true;
7779
}
7880
//---------------------------------------------------------------------------
7981
void __fastcall TMainForm::btnDeleteClick(TObject *Sender)
@@ -123,13 +125,14 @@ void __fastcall TMainForm::gvLayoutsFocusedRecordChanged(
123125
(DataModule1->mdLayouts->State != dsInsert))
124126
{
125127
LoadLayoutAndState();
126-
}
128+
}
127129
}
128130
//---------------------------------------------------------------------------
129131

130132
void __fastcall TMainForm::dxDashboardControl1LayoutChanged(
131133
TdxCustomDashboardControl *ASender)
132134
{
135+
dxDashboardControl1->Active = true;
133136
if (DataModule1->mdLayoutsName->AsString != dxDashboardControl1->DashboardName)
134137
{
135138
DataModule1->mdLayouts->Append();

CPB/uMainForm.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ class TMainForm : public TForm
7373
TdxLayoutItem *liBtnNew;
7474
TdxLayoutGroup *lgButtons;
7575
TdxLayoutItem *liBtnDelete;
76-
TcxGridDBColumn *gvLayoutsState;
7776
void __fastcall btnNewDashboardClick(TObject *Sender);
7877
void __fastcall btnDeleteClick(TObject *Sender);
7978
void __fastcall btnDesignClick(TObject *Sender);

0 commit comments

Comments
 (0)