Blazorise Specifications: TreeView

Learn how the TreeView behaves when selection, expansion, and virtualization are combined.

SelectionMode

SelectionMode.Single uses SelectedNode and selection happens by clicking the node content. SelectionMode.Multiple uses SelectedNodes and selection happens via the checkbox; clicking node content does not toggle selection in multiple mode.

Disabled nodes from IsDisabled ignore clicks and checkbox changes and are styled through DisabledNodeStyling.

Expansion and ExpandedNodes

Expanded state is tracked in ExpandedNodes. Toggling a node updates the list and raises ExpandedNodesChanged. When ExpandedNodes changes externally, the TreeView synchronizes expansion on the next parameter set and loads children for newly expanded nodes.

AutoExpandAll runs only once during the initial load. It expands nodes that report children and updates ExpandedNodes.

Child Loading

Child nodes are loaded lazily using GetChildNodes or GetChildNodesAsync when a node expands. HasChildNodes/HasChildNodesAsync determines whether the expand toggle is shown.

Virtualize

When Virtualize is enabled, each expanded node list is rendered using Blazor's Virtualize component. If Height or Overflow are not explicitly set, the TreeView defaults to a height of 300px and Overflow.Auto.

On this page