TabStrip State Management
The Telerik TabStrip for Blazor exposes state management capabilities through events and methods. Use them to save, restore, and programmatically manipulate the component state, for example, to persist it across page visits or to respond to state changes.
Objects
The TabStrip stores its state in the following objects:
TabStripState—the state of the TabStrip component and all tabsTabStripTabState—the state of a specific tab
Events
The TabStrip fires two events that enable you to monitor the component state or set it initially:
Also see the example below.
Methods
The GetState and SetState methods of the TabStrip instance let you obtain and define the current TabStrip state on demand at any time after OnStateInit.
To make changes to the TabStrip state:
- Get the current state with the
GetStatemethod. - Apply the desired modifications to the obtained
TabStripStateobject. - Set the modified state object through the
SetStatemethod.
Do not use
GetState()in theOnStateInitorOnStateChangedevents. Do not useSetState()inOnStateInit. Instead, get or set theTabStripStateproperty of the event argument.
Example
The following sample demonstrates the TabStrip state-related events and methods in action.