• What is KendoReact
  • Getting Started
  • Server Components
  • Components
  • Sample Applications
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Changelog
  • Updates
  • Troubleshooting

Deleting TreeView Nodes

Environment

ProductProgress® KendoReact

Description

Can I delete TreeView Nodes?

Solution

Create custom item rendering through TreeView's "item" property. Define the custom item outside of the main component.

Since the delete function will be within the main component where the TreeView is rendered, use React Context for passing reference to the function to the nodes. Within the custom item add a delete icon/button and on its onClick event, return the props (where the item info is accessible).

Following is an example demonstrating the approach:

Example
View Source
Change Theme:

In this article

Not finding the help you need?