Prevent node from being dropped over root

5 posts, 0 answers
  1. Anis
    Anis avatar
    4 posts
    Member since:
    Dec 2011

    Posted 19 Jan 2012 Link to this post

    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.
  2. King Wilder
    King Wilder avatar
    240 posts
    Member since:
    Oct 2007

    Posted 03 May 2012 Link to this post

    This is answered in the documentation.

    TreeView --> Events --> Drag event

    I hope this helps.
  3. Kendo UI is VS 2017 Ready
  4. Vincent
    Vincent avatar
    2 posts
    Member since:
    Mar 2016

    Posted 29 Mar Link to this post

    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

  5. Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 04 Apr Link to this post

    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!
     
  6. Vincent
    Vincent avatar
    2 posts
    Member since:
    Mar 2016

    Posted 04 Apr in reply to Daniel Link to this post

    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.
Back to Top
Kendo UI is VS 2017 Ready