Forum Discussion

Sergey's avatar
Sergey
Contributor III
16 days ago

Dynamically change the dashboard layout

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,

  • Sergey's avatar
    Sergey
    Contributor III

    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

  • RobbSalzmann's avatar
    RobbSalzmann
    Valued Contributor II

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