Scroll while Dragging inside RadListControl

2 posts, 0 answers
  1. Nafeh
    Nafeh avatar
    1 posts
    Member since:
    Sep 2016

    Posted 01 Sep Link to this post

    Hi,

    I am usingRadListControl to show some bound data and implemented drag-drop following the instruction given here. The Drag drop works okay, but I need to implement scrolling while dragging an item so that it can be dropped anywhere the user wants to. I've tried to search for it, but was not successful. Could anyone please provide any solution or workaround for this?

    Thanks

  2. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 02 Sep Link to this post

    Hello Nafeh,

    Thank you for writing.

    You can use the DragOver event and check if the mouse is in the bottom part of the list view:
    private void RadListControl1_DragOver(object sender, DragEventArgs e)
    {
        var point = this.PointToClient(new Point(e.X, e.Y));
        
        var rect = new Rectangle(new Point(0 , radListControl1.Location.Y + (radListControl1.Height / 4) *3 ), new Size(radListControl1.Width, radListControl1.Height / 4));
        if (rect.Contains(point))
        {
            if (radListControl1.ListElement.VScrollBar.Value + 10 < radListControl1.ListElement.VScrollBar.Maximum - radListControl1.Height)
            {
                radListControl1.ListElement.VScrollBar.Value += 10;
                Application.DoEvents();
            }
        }
    }

    I hope this will be useful. 

    Regards,
    Dimitar
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top