alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class TreeViewEvents<TValue>

    The TreeView allows us to control the component by using events.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    TreeViewEvents<TValue>
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.BuildRenderTree(RenderTreeBuilder)
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnAfterRenderAsync(bool)
    ComponentBase.OnInitialized()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.Dispose(bool)
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    Namespace: Syncfusion.Blazor.Navigations
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class TreeViewEvents<TValue> : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    Type Parameters
    Name Description
    TValue

    "TValue parameter".

    Constructors

    TreeViewEvents()

    Declaration
    public TreeViewEvents()

    Properties

    Created

    Gets or sets an event callback that is raised when the TreeView component is created successfully.

    Declaration
    [Parameter]
    public EventCallback<ActionEventArgs> Created { get; set; }
    Property Value
    Type Description
    EventCallback<ActionEventArgs>

    An event callback function.

    Remarks

    You can perform required actions during this component creation.

    DataBound

    Gets or sets an event callback that is raised when data source is populated in the TreeView.

    Declaration
    [Parameter]
    public EventCallback<DataBoundEventArgs<TValue>> DataBound { get; set; }
    Property Value
    Type Description
    EventCallback<DataBoundEventArgs<TValue>>

    An event callback function.

    Remarks

    The data can be modified or updated at this time when the component is updated with data source.

    DataSourceChanged

    Gets or sets an event callback that is raised when data source is changed in the TreeView. The data source will be changed after performing some operation like drag and drop, node editing, adding, and removing node.

    Declaration
    [Parameter]
    public EventCallback<DataSourceChangedEventArgs<TValue>> DataSourceChanged { get; set; }
    Property Value
    Type Description
    EventCallback<DataSourceChangedEventArgs<TValue>>

    An event callback function.

    Remarks

    The data source change can be detected and the updated data can be fetched or stored in required cases.

    Destroyed

    Gets or sets an event callback that is raised when the TreeView component is destroyed successfully.

    Declaration
    [Parameter]
    public EventCallback<ActionEventArgs> Destroyed { get; set; }
    Property Value
    Type Description
    EventCallback<ActionEventArgs>

    An event callback function.

    Remarks

    Required actions can be performed once the component is destroyed.

    NodeChecked

    Gets or sets an event callback that is raised when the TreeView node is checked/unchecked successfully.

    Declaration
    [Parameter]
    public EventCallback<NodeCheckEventArgs> NodeChecked { get; set; }
    Property Value
    Type Description
    EventCallback<NodeCheckEventArgs>

    An event callback function.

    Remarks

    The details of checked/unchecked node can be fetched and required actions can be performed using this event.

    NodeChecking

    Gets or sets an event callback that is raised before the TreeView node is to be checked/unchecked.

    Declaration
    [Parameter]
    public EventCallback<NodeCheckEventArgs> NodeChecking { get; set; }
    Property Value
    Type Description
    EventCallback<NodeCheckEventArgs>

    An event callback function.

    Remarks

    Check/uncheck action can be prevented for specific nodes in required cases.

    NodeClicked

    Gets or sets an event callback that is raised when the TreeView node is clicked successfully.

    Declaration
    [Parameter]
    public EventCallback<NodeClickEventArgs> NodeClicked { get; set; }
    Property Value
    Type Description
    EventCallback<NodeClickEventArgs>

    An event callback function.

    Remarks

    Required actions can be performed on node click using this event.

    NodeCollapsed

    Gets or sets an event callback that is raised when the TreeView node collapses successfully.

    Declaration
    [Parameter]
    public EventCallback<NodeExpandEventArgs> NodeCollapsed { get; set; }
    Property Value
    Type Description
    EventCallback<NodeExpandEventArgs>

    An event callback function.

    Remarks

    Helps to identify that a node is collapsed and the collapsed node details can be fetched in this event.

    NodeCollapsing

    Gets or sets an event callback that is raised before the TreeView node collapses.

    Declaration
    [Parameter]
    public EventCallback<NodeExpandEventArgs> NodeCollapsing { get; set; }
    Property Value
    Type Description
    EventCallback<NodeExpandEventArgs>

    An event callback function.

    Remarks

    Collapse action can be prevented for specific nodes in required cases.

    NodeDropped

    Gets or sets an event callback that is raised when the TreeView node is dropped on target element successfully.

    Declaration
    [Parameter]
    public EventCallback<DragAndDropEventArgs> NodeDropped { get; set; }
    Property Value
    Type Description
    EventCallback<DragAndDropEventArgs>

    An event callback function.

    Remarks

    Helps to identify the node drop action and the dropped index/target can be fetched to perform required actions.

    NodeEdited

    Gets or sets an event callback that is raised when the TreeView node is renamed successfully.

    Declaration
    [Parameter]
    public EventCallback<NodeEditEventArgs> NodeEdited { get; set; }
    Property Value
    Type Description
    EventCallback<NodeEditEventArgs>

    An event callback function.

    Remarks

    Helps to identify that the node is edited successfully and the new edited text can be obtained here.

    NodeEditing

    Gets or sets an event callback that is raised before the TreeView node is renamed.

    Declaration
    [Parameter]
    public EventCallback<NodeEditEventArgs> NodeEditing { get; set; }
    Property Value
    Type Description
    EventCallback<NodeEditEventArgs>

    An event callback function.

    Remarks

    Node editing can be prevented for specific nodes using this event.

    NodeExpanded

    Gets or sets an event callback that is raised when the TreeView node expands successfully.

    Declaration
    [Parameter]
    public EventCallback<NodeExpandEventArgs> NodeExpanded { get; set; }
    Property Value
    Type Description
    EventCallback<NodeExpandEventArgs>

    An event callback function.

    Remarks

    Helps to identify that a node is expanded and the expanded node details can be fetched using this event.

    NodeExpanding

    Gets or sets an event callback that is raised before the TreeView node is to be expanded.

    Declaration
    [Parameter]
    public EventCallback<NodeExpandEventArgs> NodeExpanding { get; set; }
    Property Value
    Type Description
    EventCallback<NodeExpandEventArgs>

    An event callback function.

    Remarks

    Expand action can be prevented for specific nodes in required cases using this event.

    NodeSelected

    Gets or sets an event callback that is raised when the TreeView node is selected/unselected successfully.

    Declaration
    [Parameter]
    public EventCallback<NodeSelectEventArgs> NodeSelected { get; set; }
    Property Value
    Type Description
    EventCallback<NodeSelectEventArgs>

    An event callback function.

    Remarks

    Selected node details can be obtained here and updated to required places using this event.

    NodeSelecting

    Gets or sets an event callback that is raised before the TreeView node is selected/unselected.

    Declaration
    [Parameter]
    public EventCallback<NodeSelectEventArgs> NodeSelecting { get; set; }
    Property Value
    Type Description
    EventCallback<NodeSelectEventArgs>

    An event callback function.

    Remarks

    A specific node selection can be prevented using this event.

    OnActionFailure

    Gets or sets an event callback that is raised while any TreeView action failed to fetch the desired results.

    Declaration
    [Parameter]
    public EventCallback<FailureEventArgs> OnActionFailure { get; set; }
    Property Value
    Type Description
    EventCallback<FailureEventArgs>

    An event callback function.

    Remarks

    You can capture this failure and throw error message for users in required cases.

    OnKeyPress

    Gets or sets an event callback that is raised when key press is successful.

    Declaration
    [Parameter]
    public EventCallback<NodeKeyPressEventArgs> OnKeyPress { get; set; }
    Property Value
    Type Description
    EventCallback<NodeKeyPressEventArgs>

    An event callback function.

    Remarks

    Helps to customize the operations at key press.

    OnNodeDragStart

    Gets or sets an event callback that is raised when the TreeView node drag (move) starts.

    Declaration
    [Parameter]
    public EventCallback<DragAndDropEventArgs> OnNodeDragStart { get; set; }
    Property Value
    Type Description
    EventCallback<DragAndDropEventArgs>

    An event callback function.

    Remarks

    Helps to identify the dragged node details. Dragging can be prevented for specific node in required cases.

    OnNodeDragStop

    Gets or sets an event callback that is raised when the TreeView node dragging (move) stops.

    Declaration
    [Parameter]
    public EventCallback<DragAndDropEventArgs> OnNodeDragStop { get; set; }
    Property Value
    Type Description
    EventCallback<DragAndDropEventArgs>

    An event callback function.

    Remarks

    Helps to identify the node drag stop action. Dropped target can be fetched and used to perform required actions.

    OnNodeDragged

    Gets or sets an event callback that is raised when the TreeView node is dragged.

    Declaration
    [Parameter]
    public EventCallback<DragAndDropEventArgs> OnNodeDragged { get; set; }
    Property Value
    Type Description
    EventCallback<DragAndDropEventArgs>

    An event callback function.

    Remarks

    Helps to identify the node drag action.

    OnNodeRender

    Gets or sets an event callback that is raised before the TreeView node is appended to the TreeView element.

    Declaration
    [Parameter]
    public EventCallback<NodeRenderEventArgs<TValue>> OnNodeRender { get; set; }
    Property Value
    Type Description
    EventCallback<NodeRenderEventArgs<TValue>>

    An event callback function.

    Remarks

    A specific node can be customized at the time of rendering using this event.

    Methods

    OnInitializedAsync()

    Method invoked when the component is ready to start.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type Description
    Task

    A System.Threading.Tasks.Task representing any asynchronous operation.

    Overrides
    ComponentBase.OnInitializedAsync()

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved