New to Telerik UI for BlazorStart a free 30-day trial

DockManager State

Updated on Aug 31, 2026

The DockManager lets you read, save, load, and change its state through code. The state includes the DockManager features that are controlled by the user, such as the pane resizing, orientation, pinning, docking, and many others.

This article describes:

Information in the DockManager State

The DockManagerState object exposes a collection of all the floating panes including their settings.

Events

The DockManager features two events, which are related to its state.

OnStateInit

The OnStateInit event fires when the DockManager is initializing. Use this event to:

  • Define initial state, for example default initial panes position;
  • Load and apply state that was previously saved in a database or in localStorage.

The event argument is of type DockManagerStateEventArgs and has a DockManagerState property. See Information in the DockManager State for details.

OnStateChanged

OnStateChanged fires when the user performs an action that changes the value of a property in the DockManager state. The event argument is of type DockManagerStateEventArgs and exposes the component current DockManagerState.

Methods

The GetState and SetState methods of the DockManager instance let you get and set the current DockManager state on demand at any time after OnStateInit.

  • GetState returns the current DockManager state, so you can save it or retrieve specific information. For example, you can use GetState to get the current panes position. Or, you can get the current panes size.

  • SetStateAsync receives an instance of a DockManagerState object and applies it to the DockManager. For example, you can have a button that puts the DockManager in a certain configuration programmatically, for example pane positioning, docking, etc.

If you want to make changes to the current DockManager state:

  1. First, get the current state with the GetState method.
  2. Apply the desired modifications to the obtained DockManagerState object.
  3. Set the modified state object via the SetState method.

Do not use GetState() in the OnStateInit or OnStateChanged events. Do not use SetState() in OnStateInit. Instead, get or set the DockManagerState property of the event argument.

To reset the DockManager state to its initial markup configuration, use the GetState() and SetState() methods. The Reset DockManager State on Button Click in Blazor KB article demonstrates this approach.

Example

The example below shows how to restore the previous state of the DockManager on page refresh.

Using DockManager State Events and Methods

Example
View Source
Loading ...

See Also