Is DockManager state saving completely broken?

1 Answer 21 Views
DockManager
Vitaly
Top achievements
Rank 1
Vitaly asked on 27 Mar 2025, 03:10 AM | edited on 27 Mar 2025, 04:01 AM

Hello Telerik,

Thank you for the recently released DockManager component. It really helps,

However, I am trying to use the DockManager's persistent state (GetState(), SetState(), OnStateInit, OnStateChanged), and it seems that the DockManagerState object provided by GetState() and the events is simply wrong:

  • Panel sizes are a mix of their current values, old values and the initial Size settings;
  • When restoring a saved state, sizes are applied inconsistently;
  • SetState(null) does literally nothing.

My goal is to save the DockManager's layout in an external string, then restart the application and restore the DockManager's layout from that string.

From a quick stepthrough, one of the problem places is DockManagerContentPane.SetUnpinned(). It  forces a refresh on the same pane that is being configured from the saved state, and its size reverts to the default. Possibly, it happens more often for panes with a constant Id property.

Update. If I remove Id properties from all content panes, then the layout has the right size, but all panes are empty. No content. If I put Id properties back, I get the content, but the pane size is lost.

 

Can you please confirm that you are aware of the problem? To create a reproducible example app may be too hard.

1 Answer, 1 is accepted

Sort by
0
Anislav
Top achievements
Rank 6
Silver
Bronze
Iron
answered on 27 Mar 2025, 09:54 AM
Hi Vitaly,

The DockManager is a new component, so I also tested its state-saving and restoring functionality, and it appears to work as expected. I created an example that demonstrates this, including a mock application restart: https://blazorrepl.telerik.com/cJYHQBYZ451qWxq419 .

Based on your comment, it seems that you might be setting the DockManager state too early. Please note the following from the documentation:

> The GetState and SetState methods of the DockManager instance allow you to retrieve and apply the current DockManager state at any time after OnStateInit.

It is recommended providing a handler for the OnStateInit event and setting the DockManager state there, if you are not already doing so. 

Regards,
Anislav Atanasov
Anislav
Top achievements
Rank 6
Silver
Bronze
Iron
commented on 08 Apr 2025, 10:55 AM

Did you get it working?
Tags
DockManager
Asked by
Vitaly
Top achievements
Rank 1
Answers by
Anislav
Top achievements
Rank 6
Silver
Bronze
Iron
Share this question
or