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

Unselect Node Dropped Outside of Tree

1 Answer 68 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 2
Joe asked on 24 Jan 2008, 05:54 PM
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

1 Answer, 1 is accepted

Sort by
0
Joe
Top achievements
Rank 2
answered on 24 Jan 2008, 06:10 PM
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
Tags
TreeView
Asked by
Joe
Top achievements
Rank 2
Answers by
Joe
Top achievements
Rank 2
Share this question
or