Unselect Node Dropped Outside of Tree

2 posts, 0 answers
  1. Joe Hakooz
    Joe Hakooz avatar
    65 posts
    Member since:
    Dec 2007

    Posted 24 Jan 2008 Link to this post

    Hi,
    In this online example...
    http://www.telerik.com/demos/aspnet/prometheus/TreeView/Examples/Functionality/DragAndDropNodes/DefaultCS.aspx

    Click and drag an item from TreeView1 and drop it on an empty space on the page. (But not on the other tree, input, or datagrid) See how it stays highlighted?

    Is there any way to un-highlight the node in that situation?
    The reason is because it may be confusing to the user to "cancel" the drop by dropping the node outside of the tree, but low and behold, it's still highlighted.

    Not a huge deal but would be icing on the cake.

    Thanks,
    Joe
  2. Joe Hakooz
    Joe Hakooz avatar
    65 posts
    Member since:
    Dec 2007

    Posted 24 Jan 2008 Link to this post

    Resolved....

    Referring to the ASPX code in the above example, here's the solution:

    function onNodeDropping(sender, args)
    {           
        var dest = args.get_destNode();
        if (dest)
        {
            // bunch o stuff
        }
            // Here's the unselect no matter what fix
            var node = args.get_sourceNode();       
            node.set_selected(false);
    }

    Hope that helps
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top