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

display different cursor if over invalid drop area?

1 Answer 124 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Sheryl Landon
Top achievements
Rank 1
Sheryl Landon asked on 11 Aug 2008, 04:39 PM
The documentation hints that you can, for example, change the mouse cursor during a drag operation in the OnClientNodeDragging event depending on if the cursor is over a valid or invalid drop location, and shows how to get the X/Y coordinates of the cursor. 

But, does anyone have an example of how you could translate the X/Y into an actual html element or control, to determine if the current location is valid or not?

1 Answer, 1 is accepted

Sort by
0
Sean
Top achievements
Rank 2
answered on 11 Aug 2008, 06:26 PM
Hi Sheryl,

Check out :
http://www.telerik.com/DEMOS/ASPNET/prometheus/TreeView/Examples/Functionality/DragAndDropNodes/DefaultCS.aspx

If you look at then aspx code, you will see the javascript function you need:
function onNodeDragging(sender, args)  
                {  
                    var target = args.get_htmlElement();      
                      
                    if(!target) return;  
                      
                    if (target.tagName == "INPUT")  
                    {          
                        target.style.cursor = "hand";  
                    }  
 
                    var grid = isMouseOverGrid(target)  
                    if (grid)  
                    {  
                        grid.style.cursor = "hand";  
                    }  
                }  
 

Thanks for listening!

Sean
Electronic Arts, Orlando, FL
Tags
TreeView
Asked by
Sheryl Landon
Top achievements
Rank 1
Answers by
Sean
Top achievements
Rank 2
Share this question
or