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

Scroll while Dragging inside RadListControl

1 Answer 119 Views
ListControl
This is a migrated thread and some comments may be shown as answers.
Nafeh
Top achievements
Rank 1
Nafeh asked on 01 Sep 2016, 07:01 AM

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

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 02 Sep 2016, 12:58 PM
Hello ,

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.
Tags
ListControl
Asked by
Nafeh
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or