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

scroll Listview while dragging item

4 Answers 360 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Froggie
Top achievements
Rank 1
Froggie asked on 14 Feb 2012, 02:42 PM
According to this Thread I tried to implement the (missing?) feature, but there is no "ScrollableRows" in RadListView.
How can I achieve my goal?

4 Answers, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 17 Feb 2012, 12:37 PM
Hello Froggie,

Thank you for contacting us.

RadListView is fairly different control than RadGridView and has different structure and properties. As far as I understand from the forum thread you have linked, you want to be able to drag and drop items with automatic scrolling when dragging past the bounds of the control. This is functionality is built-in in RadListView. You can enable this by simply setting:
this.radListView1.AllowDragDrop = true;

Please let me know if this doesn't fit your scenario or if you have any additional questions.

Regards,
Ivan Todorov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Froggie
Top achievements
Rank 1
answered on 17 Feb 2012, 01:36 PM
Okay.
Why this doesn't work in the linked application? (And how can I achieve this?)
http://www.file-upload.net/download-4123883/RadGridTest.zip.html

PS: Also notice the changing Background (see other Thread).
0
Accepted
Ivan Todorov
Telerik team
answered on 21 Feb 2012, 04:21 PM
Hello Froggie,

Thank you for the sample project.

The built-in drag-drop feature of RadListView does not work in your case because you are using RadListView in bound mode and this is not yet supported. I have logged this to our Public Issue Tracking System as a feature request so you can subscribe to it and track it for any progress. Here is the link to the PITS entry. I have also updated your Telerik points for your request.

Back to your original approach, to implement scrolling while dragging an item, you need to handle the QueryContinueDrag event as it is shown below:
void radListView1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
{
    Point pt = radListView1.PointToClient(Control.MousePosition);
    if (pt.Y < 0)
    {
        this.radListView1.ListViewElement.ViewElement.ScrollTo(1);
    }
    else if (pt.Y > this.radListView1.Height)
    {
        this.radListView1.ListViewElement.ViewElement.ScrollTo(-1);
    }
}

In regards to your questions about resetting the background of RadListViewElement, please check my reply in this forum thread.

Do not hesitate to write back if you have any additional questions.

All the best,
Ivan Todorov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Froggie
Top achievements
Rank 1
answered on 21 Feb 2012, 04:31 PM
Thank you for your reply.
Both of my problems are solved now. Thank you.
Tags
ListView
Asked by
Froggie
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Froggie
Top achievements
Rank 1
Share this question
or