Skip to main content
March 17, 2025

Dynamically change the dashboard layout

  • March 17, 2025
  • 2 replies
  • 0 views

Hello,

I have a weird behaviour when defining dynamically the dashboard layout.

If I define dynamically the dashboard layout to be either a vertical stack panel, horizontal stack panel, or uniform, then all of my components render as expected.

However, if I want to define them as grid (3 rows, 2 columns), then nothing is rendered.

I did use (in that order, if that has any consequences) :

  • contant DashboardLayoutType.Grid
  • property GridLayoutDefinition.RowDefinitions as a list of xfgridlayoutrowdefinition
  • property GridLayoutDefinition.ColumnDefinitions as a list of xfgridlayoutcolumndefinition

The logs are telling me that the dashboard indeed is now a grid with 3 rows and 2 columns, however all of my components are not rendered in the dashboard.

Being a grid :



Being a vertical stack panel, horizontal stack panel, or uniform :

 



I do know that a grid is intepreted differently as a XAML grid class but I have no clue why it wouldn't be rendered with my components in it.

Any help or insight on this is greatly appreciated,

Regards,

2 replies

SergeyAuthor
March 17, 2025

Found the solution in defining the dashboard layout  GetEmbeddedDynamicDashboard public function of the dynamic dashboard services : using api.SaveDynamicDashboardState there for defining the XFGridLayoutDefinition. The components still are declared and created in the GetDynamicComponentsForDynamicDashboard public function

March 18, 2025

Curious if your reference to XAML is based on experience with WPF?