Edit the text of a Treeview item node

1 Answer 108 Views
Editor TreeView
Michael
Top achievements
Rank 1
Michael asked on 25 Oct 2021, 08:09 AM | edited on 25 Oct 2021, 08:10 AM
I have a requirement where the user needs to be able to add a node to the treeview, which I have working. The requirement however is to NOT use a popup to prompt for the text for the node, but rather add the node - and have it editable straight away. The users can then enter the text, and either hit enter, or press/click somewhere else on the screen to commit the text change - and in turn - call the relevant API endpoint to persist the text.

Any ideas? Was hoping for an <EditItemTemplate> of sorts, but only <ItemTemplate> seems to be available.

Any assist appreciated :)
Michael
Top achievements
Rank 1
commented on 25 Oct 2021, 08:51 AM

I have stumbled across the TelerikTreeList component. Is this the only way to do it?

1 Answer, 1 is accepted

Sort by
0
Svetoslav Dimitrov
Telerik team
answered on 27 Oct 2021, 11:41 AM

Hello Michael,

Indeed, you are correct that the TreeList would be a good replacement for the TreeView in cases you need built-in CRUD operations. Another alternative would be to use the Rename node demo application as a basis. This application showcases how to edit the text for a node in a TreeView without the need for a popup window. 

Regards,
Svetoslav Dimitrov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Editor TreeView
Asked by
Michael
Top achievements
Rank 1
Answers by
Svetoslav Dimitrov
Telerik team
Share this question
or