# Persisting the Expanded Node State

The MultiSelectTree enables you to define and persist the expanded state of its nodes when the popup TreeView is re-rendered.

## Manual Setup

The MultiSelectTree exposes the following options to control the expanded state of its nodes:

* [`isNodeExpanded`](https://www.telerik.com/kendo-angular-ui/components/dropdowns/api/multiselecttreecomponent#isnodeexpanded) (`(node: any) => boolean`)—Determines if a given node is expanded.
* [`nodeCollapse`](https://www.telerik.com/kendo-angular-ui/components/dropdowns/api/multiselecttreecomponent#nodecollapse) (`EventEmitter<any>`)—Fired when a given node is about to be collapsed.
* [`nodeExpand`](https://www.telerik.com/kendo-angular-ui/components/dropdowns/api/multiselecttreecomponent#nodeexpand) (`EventEmitter<any>`)—Fired when a given node is about to be expanded.

The following example demonstrates how to manually track and control the expanded node state.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/dropdowns/multiselecttree/expand_state/manual_setup/source.txt)

## Using the Built-In Directive

By default, the built-in [`kendoMultiSelectTreeExpandable`](https://www.telerik.com/kendo-angular-ui/components/dropdowns/api/dropdowntreesexpanddirective) directive persists the expanded nodes based on their hierarchical index.

The following example demonstrates how the `kendoMultiSelectTreeExpandable` directive automatically tracks and persists the expanded node state.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/dropdowns/multiselecttree/expand_state/expand_directive/source.txt)

## Suggested Links

* [API Reference of the MultiSelectTree](https://www.telerik.com/kendo-angular-ui/components/dropdowns/api/multiselecttreecomponent)
* [API Reference of the Expand Directive](https://www.telerik.com/kendo-angular-ui/components/dropdowns/api/dropdowntreesexpanddirective)
