Class TreeViewEvents<TValue>
The TreeView allows us to control the component by using events.
Inheritance
Namespace: Syncfusion.Blazor.Navigations
Assembly: Syncfusion.Blazor.dll
Syntax
public class TreeViewEvents<TValue> : OwningComponentBase
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
public EventCallback<ActionEventArgs> Created { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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
public EventCallback<DataBoundEventArgs<TValue>> DataBound { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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
public EventCallback<DataSourceChangedEventArgs<TValue>> DataSourceChanged { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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 control is destroyed successfully.
Declaration
public EventCallback<ActionEventArgs> Destroyed { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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
public EventCallback<NodeCheckEventArgs> NodeChecked { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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
public EventCallback<NodeCheckEventArgs> NodeChecking { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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
public EventCallback<NodeClickEventArgs> NodeClicked { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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
public EventCallback<NodeExpandEventArgs> NodeCollapsed { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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
public EventCallback<NodeExpandEventArgs> NodeCollapsing { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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
public EventCallback<DragAndDropEventArgs> NodeDropped { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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
public EventCallback<NodeEditEventArgs> NodeEdited { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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
public EventCallback<NodeEditEventArgs> NodeEditing { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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
public EventCallback<NodeExpandEventArgs> NodeExpanded { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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
public EventCallback<NodeExpandEventArgs> NodeExpanding { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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
public EventCallback<NodeSelectEventArgs> NodeSelected { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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
public EventCallback<NodeSelectEventArgs> NodeSelecting { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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
public EventCallback<FailureEventArgs> OnActionFailure { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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
public EventCallback<NodeKeyPressEventArgs> OnKeyPress { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<NodeKeyPressEventArgs> | An event callback function. |
Remarks
Helps to customize the operations at key press.
OnNodeDragged
Gets or sets an event callback that is raised when the TreeView node is dragged.
Declaration
public EventCallback<DragAndDropEventArgs> OnNodeDragged { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<DragAndDropEventArgs> | An event callback function. |
Remarks
Helps to identify the node drag action.
OnNodeDragStart
Gets or sets an event callback that is raised when the TreeView node drag (move) starts.
Declaration
public EventCallback<DragAndDropEventArgs> OnNodeDragStart { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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
public EventCallback<DragAndDropEventArgs> OnNodeDragStop { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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.
OnNodeRender
Gets or sets an event callback that is raised before the TreeView node is appended to the TreeView element.
Declaration
public EventCallback<NodeRenderEventArgs<TValue>> OnNodeRender { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.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 |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing any asynchronous operation. |