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

Scrolling during drag and drop

3 Answers 82 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Stuart Hemming
Top achievements
Rank 2
Stuart Hemming asked on 26 Jul 2011, 11:31 AM
I've a TreeView in a RadSplitterPane.

The TreeView is set to allow drag and drop.

ATM, I can only drag to a node I can see at the beginning of the drag and drop operation as I seem unable to get either to TreeView or the SplitterPane to scroll.

Is there, actually, a way to do this?

-- 
Stuart

3 Answers, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 29 Jul 2011, 11:39 AM
Hi Stuart,

As you have noticed the container wrapping the RadTreeView is not scrolling, which is expected behavior since the user could scroll using the mouse while dragging.

The desired functionality could be achieve using custom implementation. You should monitor the cursor position on the page and if cursor is near the bottom or top of the container, you should scroll it manually.

Greetings,
Dimitar Terziev
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Scott
Top achievements
Rank 1
answered on 19 Dec 2011, 06:46 PM
I'm having the exact same problem.  I have a RadTreeView in a RadSplitter Pane.  Both are within an iFrame.  I also have a manual scroll using the scrollBy method in Window.  When the dragged node reaches the bottom, instead of scrolling the pane, it scrolls the entire frame, not the TreeView.  Here's the Javascript:

function onNodeDragging(sender, args)
{
    var target = args.get_htmlElement();    
      
    if(!target) return;
      
    if (target.tagName == "INPUT")
    {        
        target.style.cursor = "hand";
    }
    var container = sender.get_element();
    var divYCoord = $telerik.getLocation(container).y;
    var currentYCoord = args.get_domEvent().clientY;
    var textbox = $get("textbox");
      
    if (currentYCoord > (document.body.clientHeight - 20))
        window.scrollBy(0, 20);
    if(currentYCoord < 620)
        window.scrollBy(0, -20);
    window.status = "RadPane1.clientHeight:" + radPane1.clientHeight + ":document.body.clientHeight:" + document.body.clientHeight + ":currentYCoord:" + currentYCoord + ":document.body.scrollTop:" + document.body.scrollTop + ":iTop:" + (currentYCoord - document.body.scrollTop) + ":" + args.get_domEvent().screenY + ":" + divYCoord;
}

Thanks,

Scott
0
Dimitar Terziev
Telerik team
answered on 22 Dec 2011, 03:28 PM
Hi Scott,

Since you have opened a support ticket regarding this issue, lets keep the discussing there until we find a solution.

All the best,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
TreeView
Asked by
Stuart Hemming
Top achievements
Rank 2
Answers by
Dimitar Terziev
Telerik team
Scott
Top achievements
Rank 1
Share this question
or