cbe06c7fcd | ||
---|---|---|
.. | ||
rename-node | ||
readme.md | ||
rename-node.sln |
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:
- Create a component that will provide the desired item rendering and editing UX.
- In this sample, it is the
~/Shared/EditableTreeNode.razor
component.
- In this sample, it is the
- Put that component in the
ItemTemplate
of your treeview. - Pass to that component the current item that it will render and edit.
- We pass it as a parameter to the child component.
- 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.