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

A hierarchical list component with expand/collapse, selection, checkboxes, and drag-and-drop. Bind data via TreeViewBindings using TreeViewBinding; control expanded nodes with ExpandedItems/ExpandedItemsChanged and handle expand via OnExpand. Manage selection through SelectionMode and SelectedItems/SelectedItemsChanged; enable checkbox modes with CheckBoxMode and synchronize using CheckedItems/CheckedItemsChanged with CheckChildren/CheckParents/CheckOnClick. Enable drag-and-drop with Draggable and handle lifecycle via OnDragStart, OnDrag, OnDragEnd, and finalize in OnDrop. Item events: OnItemClick, OnItemDoubleClick, OnItemContextMenu; per-item rendering via OnItemRender.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

C#
public class TelerikTreeView : DataBoundComponent<object>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseBaseComponentDataBoundComponent<object>TelerikTreeView

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members DataBoundComponent<object>.Dispose()DataBoundComponent<object>.Rebind()DataBoundComponent<object>.DataBaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeVoidAsyncWithoutAwait(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnInitialized()ComponentBase.OnParametersSet()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)...

Properties

[Accessibility] Describe the aria-label attribute for the component.

C#
[Parameter]
public string AriaLabel { get; set; }

[Accessibility] Describe the aria-labelledby attribute for the component.

C#
[Parameter]
public string AriaLabelledBy { get; set; }

Defines if users can check one or multiple TreeView item checkboxes. Supports Multiple, Single and None checkbox selection modes.

C#
[Parameter]
public TreeViewCheckBoxMode CheckBoxMode { get; set; }

Defines if child items' checkboxes will get checked when the user selects the parent checkbox. Applicable for Multiple TreeViewCheckMode.

C#
[Parameter]
public bool CheckChildren { get; set; }

Defines collection of Checked Items in the TreeView.

C#
[Parameter]
public IEnumerable<object> CheckedItems { get; set; }

Fires when CheckedItems collection has changed.

C#
[Parameter]
public EventCallback<IEnumerable<object>> CheckedItemsChanged { get; set; }

Defines if the click on the TreeView item should trigger checkbox selection.

C#
[Parameter]
public bool CheckOnClick { get; set; }

Defines if the parent checkbox state will change when the user toggles child checkboxes. Applicable for Multiple TreeViewCheckMode.

C#
[Parameter]
public bool CheckParents { get; set; }

Defines if users can drag TreeView items.

C#
[Parameter]
public bool Draggable { get; set; }

Specifies the time interval (in milliseconds) between the firings of the OnDrag event handler during the dragging operation. The default interval is 0ms.

C#
[Parameter]
public int DragThrottleInterval { get; set; }

Enables WebMCP tool registration for this TreeView, allowing AI models to discover and invoke tree view operations.

C#
[Parameter]
public bool EnableWebMcpTools { get; set; }

Defines collection of Expanded Items in the TreeView.

C#
[Parameter]
public IEnumerable<object> ExpandedItems { get; set; }

Triggers when ExpandedItems has changed.

C#
[Parameter]
public EventCallback<IEnumerable<object>> ExpandedItemsChanged { get; set; }

Defines the id HTML attribute of the Component.

C#
[Parameter]
public string Id { get; set; }

Fired when a tree item is being dragged.

C#
[Parameter]
public EventCallback<TreeViewDragEventArgs> OnDrag { get; set; }

Fired when a drag operation is being ended.

C#
[Parameter]
public EventCallback<TreeViewDragEndEventArgs> OnDragEnd { get; set; }

Fired when a tree item is being dragged.

C#
[Parameter]
public EventCallback<TreeViewDragStartEventArgs> OnDragStart { get; set; }

Fired when a tree item is dropped. All data manipulations should be made here.

C#
[Parameter]
public EventCallback<TreeViewDropEventArgs> OnDrop { get; set; }

Fires when the user expands or collapses a node.

C#
[Parameter]
public EventCallback<TreeViewExpandEventArgs> OnExpand { get; set; }

Fires when the user clicks, taps or presses Enter on a TreeView node (item).

C#
[Parameter]
public EventCallback<TreeViewItemClickEventArgs> OnItemClick { get; set; }

Fires when the user right-clicks on a TreeView node or taps-and-holds on a touch device.

C#
[Parameter]
public EventCallback<TreeViewItemContextMenuEventArgs> OnItemContextMenu { get; set; }

Fires when the user double-clicks or double-taps a TreeView node.

C#
[Parameter]
public EventCallback<TreeViewItemDoubleClickEventArgs> OnItemDoubleClick { get; set; }

Fired when a tree item is being rendered.

C#
[Parameter]
public Action<TreeViewItemRenderEventArgs> OnItemRender { get; set; }

Defines collection of Selected Items in the TreeView.

C#
[Parameter]
public IEnumerable<object> SelectedItems { get; set; }

Fires when SelectedItems collection has changed.

C#
[Parameter]
public EventCallback<IEnumerable<object>> SelectedItemsChanged { get; set; }

Defines if users can select one or multiple items. Supports Multiple, Single and None selection modes.

C#
[Parameter]
public TreeViewSelectionMode SelectionMode { get; set; }

Specifies the Size of the text TextBox.

C#
[Parameter]
public string Size { get; set; }

The TreeView items have features that map to properties in the model. The container enables you to create TreeViewBinding tags and configure the mappings between the features of the TreeView and the properties in the model. See TreeView Bingings. Children: TreeViewBinding tags.

C#
[Parameter]
public RenderFragment TreeViewBindings { get; set; }

Defines the settings container for the TreeView. Place TreeViewWebMcpSettings inside.

C#
[Parameter]
public RenderFragment TreeViewSettings { get; set; }

Methods

C#
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters:__builderRenderTreeBuilder

Overrides: ComponentBase.BuildRenderTree(RenderTreeBuilder)

C#
public object GetItemFromDropIndex(string index)
Parameters:indexstringReturns:

object

C#
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters:firstRenderboolReturns:

Task

Overrides: BaseComponent.OnAfterRenderAsync(bool)

C#
protected override Task OnParametersSetAsync()
Returns:

Task

Overrides: DataBoundComponent<object>.OnParametersSetAsync()

C#
public override Task SetParametersAsync(ParameterView parameters)
Parameters:parametersParameterViewReturns:

Task

Overrides: DataBoundComponent<object>.SetParametersAsync(ParameterView)