blazor-ui/treeview/rename-node
Dimo Dimov cbe06c7fcd
Update treeview/rename-node/readme.md
2021-06-29 18:24:12 +03:00
..
rename-node feat(treeview): add rename node sample 2021-06-27 11:46:11 +03:00
readme.md Update treeview/rename-node/readme.md 2021-06-29 18:24:12 +03:00
rename-node.sln feat(treeview): add rename node sample 2021-06-27 11:46:11 +03:00

readme.md

Rename TreeView Node

Tree TreeView component is a data visualization component, and it does not provide editing capabilities out-of-the-box. If your users need to perform CRUD operations a lot, you may want to consider using the TreeList component that offers built-in editing (in fact, it offers three different edit modes and UX).

If you want to add editing capabilities to your treeview, the most straight forward way to implement them is to:

  1. Create a component that will provide the desired item rendering and editing UX.
    • In this sample, it is the ~/Shared/EditableTreeNode.razor component.
  2. Put that component in the ItemTemplate of your treeview.
  3. Pass to that component the current item that it will render and edit.
    • We pass it as a parameter to the child component.
  4. Raise an event after an item was edited so the parent treeview can re-render.
    • In this sample we fetch the data from the mock database every time to ensure the TreeView is up-to-date and shows other people's edits. In your case you can choose when and how to make updates.