Blazorise TreeView component

No documentation available - no XML comment

API

Parameters

Parameter Description TypeDefault
AutoExpandAll

Specifies if the treenode should be automatically expanded. Note that it can happen only once when the tree is first loaded.

boolfalse
ChildContent

Specifies the content to be rendered inside this TreeView.

RenderFragmentnull
CollapseIconName

Specifies the name of the treenode collapse icon.

IconNameChevronDown
CollapseIconSize

Specifies the size of the treenode collapse icon.

IconSize?null
CollapseIconStyle

Specifies the style of the treenode collapse icon.

IconStyle?null
Draggable

Enables TreeView nodes to be dragged with the browser drag-and-drop API.

boolfalse
ExpandedNodes

List of currently expanded TreeView items (child nodes).

IList<TNode>new List<TNode>()
ExpandIconName

Specifies the name of the treenode expand icon.

IconNameChevronRight
ExpandIconSize

Specifies the size of the treenode expand icon.

IconSize?null
ExpandIconStyle

Specifies the style of the treenode expand icon.

IconStyle?null
NodeContent

Template to display content for the node

RenderFragment<TNode>null
NodeContextMenuPreventDefault

Used to prevent the default action for a NodeContextMenu event.

boolfalse
Nodes

Collection of child TreeView items (child nodes)

IEnumerable<TNode>null
Reorderable

Enables dropping a dragged node before another node instead of only dropping it as a child.

boolfalse
SelectedNode

Currently selected TreeView item/node.

TNodenull
SelectedNodes

Currently selected TreeView items/nodes.

IList<TNode>null
SelectionMode

Specifies the selection mode of the TreeView.

Possible values:Single, Multiple

TreeViewSelectionModeTreeViewSelectionMode.Single
Virtualize

Controls if the child nodes, which are currently not expanded, are visible. This is useful for optimizing large TreeViews. See Docs for virtualization for more info.

boolfalse

Events

Event Description Type
CanDragNode

Determines whether the specified node can be dragged.

Func<TNode, bool>
CanDropNode

Determines whether a proposed drop operation is allowed.

Func<TreeViewNodeDragEventArgs<TNode>, bool>
DisabledNodeStyling

Defines styling applied to disabled nodes.

Action<TNode, NodeStyling>
ExpandedNodesChanged

Notifies when the collection of expanded nodes has changed.

EventCallback<IList<TNode>>
GetChildNodes

Gets the list of child nodes for each node.

Func<TNode, IEnumerable<TNode>>
GetChildNodesAsync

Gets the list of child nodes for each node.

Func<TNode, Task<IEnumerable<TNode>>>
HasChildNodes

Indicates if the node has child elements.

Func<TNode, bool>
HasChildNodesAsync

Indicates if the node has child elements.

Func<TNode, Task<bool>>
IsDisabled

Indicates the node's disabled state. Used for preventing selection.

Func<TNode, bool>
NodeContextMenu

The event is fired when the node is right clicked to show the context menu.

EventCallback<TreeViewNodeMouseEventArgs<TNode>>
NodeDropped

Occurs when a node is dropped on a valid target.

Remarks

When this callback is not handled, the TreeView tries to move the node in the bound mutable collections automatically. When handled, this callback overrides the built-in move behavior.

EventCallback<TreeViewNodeDragEventArgs<TNode>>
NodeStyling

Defines styling applied to nodes.

Action<TNode, NodeStyling>
SelectedNodeChanged

Notifies when the selected TreeView node has changed.

EventCallback<TNode>
SelectedNodesChanged

Notifies when the selected TreeView nodes has changed.

EventCallback<IList<TNode>>
SelectedNodeStyling

Defines styling applied to selected nodes.

Action<TNode, NodeStyling>

Methods

Method DescriptionReturnParameters
CollapseAll Collapses all the expanded TreeView nodes. Task
ExpandAll Expands all the collapsed TreeView nodes. Task
ReloadNode Triggers the reload of a specific node and its subtree. TaskTNode node
Reload Triggers the reload of the Nodes. Task
RemoveNode Attempts to find and remove an existing node from the Treeview. TaskTNode node
SelectNode Selects the node when in single selection mode. voidTNode node
ToggleCheckNode Toggles the checked state of the node when in multiple selection mode. TaskTNode node
On this page