This is a migrated thread and some comments may be shown as answers.

Best way to change the hierarchy structure

1 Answer 102 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ewgenij
Top achievements
Rank 1
Veteran
Ewgenij asked on 03 Aug 2020, 12:30 PM
I want to be able to move a node one level higher or one level lower. That works with drag and drop, but I want to achieve it programmatically. What would be the best approach then?

1 Answer, 1 is accepted

Sort by
0
Accepted
Svet
Telerik team
answered on 05 Aug 2020, 06:34 AM

Hi Ewgenij,

In order to change the hierarchy structure of the TreeView it would be required to update its data. Indeed, there isn't a built - in feature that would allow to achieve such behavior. For example, it could be done on an event such as a button click. The developer can update the data manually so that it changes its structure as required. Once the data passed to the TreeView is updated, it should be re-rendered by the framework to demonstrate its new hierarchy structure. However we don't recommend a specific scenario of how this can be achieved as it would be based on custom logic and the implementation would depend on the specific requirements of the use - case scenario.

Regards,
Svetlin
Progress Telerik

Tags
TreeView
Asked by
Ewgenij
Top achievements
Rank 1
Veteran
Answers by
Svet
Telerik team
Share this question
or