DockManager resetting layout

1 Answer 11 Views
DockManager
Jerome
Top achievements
Rank 1
Jerome asked on 30 Jul 2025, 04:02 PM

Documentation says to reset the layout by calling: dockManager.SetState(null);

 

Doing this via code doesn't seem to do anything.  I've tried all combinations of the commented out code below.  


<TelerikDockManager Height="100vh" OnStateChanged="OnStateChanged" OnStateInit="OnStateInit" @ref="dockManager">
...

</TelerikDockManager>
<TelerikButton Icon="SvgIcon.ArrowRotateCcw" OnClick="ResetState">Reset page layout</TelerikButton>
@code{
    public TelerikDockManager dockManager { get; set; }

    public async Task ResetState()
    {
        dockManager.SetState(null);
        //dockManager.GetState();
        //dockManager.Refresh();
        //StateHasChanged();
        await InvokeAsync(() => StateHasChanged());
    }
}

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 01 Aug 2025, 07:38 AM

Hi Jerome,

Thank you for bringing this to our attention. It appears that the statement in the documentation was added by mistake. I will make sure the documentation is updated accordingly. The DockManager expects a valid state object to restore, so SetState(null) has no effect. To reset the DockManager layout to its default state dynamically, passing null to SetState() will not reset the layout

Recommended Approach:

  1. Capture the default layout state when the component first renders.
  2. Restore this saved state when you want to reset the layout (e.g., on button click).

      For more details and an example of the approach, refer to this knowledge base article: https://docs.telerik.com/blazor-ui/knowledge-base/dockmanager-reset-state

      I hope the provided approach serves you well.

        Regards,
        Tsvetomir
        Progress Telerik

        Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

        Tags
        DockManager
        Asked by
        Jerome
        Top achievements
        Rank 1
        Answers by
        Tsvetomir
        Telerik team
        Share this question
        or