scroll Listview while dragging item

5 posts, 1 answers
  1. Froggie
    Froggie avatar
    29 posts
    Member since:
    Jan 2012

    Posted 14 Feb 2012 Link to this post

    According to this Thread I tried to implement the (missing?) feature, but there is no "ScrollableRows" in RadListView.
    How can I achieve my goal?
  2. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 17 Feb 2012 Link to this post

    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 >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Froggie
    Froggie avatar
    29 posts
    Member since:
    Jan 2012

    Posted 17 Feb 2012 Link to this post

    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).
  5. Answer
    Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 21 Feb 2012 Link to this post

    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 >>
  6. Froggie
    Froggie avatar
    29 posts
    Member since:
    Jan 2012

    Posted 21 Feb 2012 Link to this post

    Thank you for your reply.
    Both of my problems are solved now. Thank you.
Back to Top
UI for WinForms is Visual Studio 2017 Ready