locked
ListView: Triggering drag when user taps instead of tap & hold RRS feed

  • Question

  • Hi,

    my App has a page whose only use is to allow the user to rearrange items in a list. I use a ListView to display the items and deal with the drag&drop-events that are fired by the ListView. Everything works fine on a desktop PC with a mouse. But if I try my app with a touch interface, it becomes very cumbersome to rearrange the list, as I have to tap an item and then hold for 2-3 seconds to move it. This is fine if I only do this with a few elements, but as the whole page is meant to allow the user to resort big lists, this behaviour isn't acceptable.

    Is there a way to trigger the dragging as soon as the user taps and holds and not after the 2-3 second delay?

    Sunday, December 22, 2013 6:56 PM

All replies

  • Hi,

    Tap an item and then hold for some seconds to move the items is the most
    common thing in listview.

    If you want to move items without hold for some seconds, you can make the
    listview SelectionMode to multiple, select an item and then select another item,
    in the listview item click event you can exchange the two items index. But I
    recommend you'd better not try this method. That can drop user experience.

    You can refer to these links to know the best guidelines for user interaction:

    http://msdn.microsoft.com/en-us/library/windows/apps/hh465415

    http://msdn.microsoft.com/en-us/library/windows/apps/jj883700.aspx

    Best Wishes!



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    • Edited by Anne Jing Monday, December 23, 2013 9:55 AM edit
    Monday, December 23, 2013 9:54 AM
  • Hi,

    thanks for you answer. I think I haven't made myself clear enough. I don't have a problem with "tap and hold" as such. The problem is that to distinguish "tap & hold" from scrolling I have to tap and then hold the finger for a few seconds without moving and then move the finger (and the item) to the desired position. Only then does the ListView start the dragging, if I just tap and immediatelly move the finger the ListView scrolls.

    Monday, December 23, 2013 11:50 AM
  • Hi there,

    I can understand your concern regarding " just tap and immediatelly move the finger the ListView scrolls." Based on samples like HTML ListView reorder and drag and drop sample, HTML ListView reorder and drag and drop sample, it's needed to tab and pull down an item (IsSwipeEnabled =True ) to make it selected then, we can perform reorder or drag/drop.

    also, note that:

    Setting IsSwipeEnabled to false disables some default touch interactions, so it should be set to true when these interactions are needed. For example:

    • If item selection is enabled and you set IsSwipeEnabled to false, a user can deselect items by right-clicking with the mouse, but can't deselect an item with touch by using a swipe gesture.
    • If you set CanDragItems to true and IsSwipeEnabled to false, a user can drag items with the mouse, but not with touch.
    • If you set CanReorderItems to true and IsSwipeEnabled to false, a user can reorder items with the mouse, but not with touch.

    On the start screen of windows 8/8.1 OS, we do not need to pull an item down but just tap it to make it selected and then perfom drag/drop. I guess you may want such effect. If so, unfortunately debugging the code is beyond the scope of a forum post. Please feel free to open a support incident.
    Please go here:
    http://aka.ms/storesupport.

    Regards,

    Jenny


    Friday, December 27, 2013 7:57 AM