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

Prevent node from being dropped over root

4 Answers 133 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Anis
Top achievements
Rank 1
Anis asked on 19 Jan 2012, 10:39 PM
In my treeview control i have a root directory and is there anyway to prevent a child node in the root from being drapped outside the root node.

4 Answers, 1 is accepted

Sort by
0
King Wilder
Top achievements
Rank 2
answered on 03 May 2012, 06:20 PM
This is answered in the documentation.

TreeView --> Events --> Drag event

I hope this helps.
0
Vincent
Top achievements
Rank 1
answered on 29 Mar 2016, 07:58 PM

This doesn't show how to prevent from dropping on the TOP Root Node. So for example, 

Root

     Child

      Child

 

NEW but Not wanted Tree structure:

Root

    CHILD

    CHILD 

CHILD

0
Daniel
Telerik team
answered on 04 Apr 2016, 06:41 AM
Hello,

Please check this example which demonstrates the scenario. In general you can use the treeview drag and drop events to restrict the treeview drag and drop behavior. 

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Vincent
Top achievements
Rank 1
answered on 04 Apr 2016, 12:32 PM
Thanks Daniel. I think the code you gave is what is needed because I couldn't determine what was a root node but your example shows it. Thank you.
Tags
TreeView
Asked by
Anis
Top achievements
Rank 1
Answers by
King Wilder
Top achievements
Rank 2
Vincent
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or