Manual drag start

6 posts, 0 answers
  1. Flemming Rosenbrandt
    Flemming Rosenbrandt avatar
    119 posts
    Member since:
    Mar 2006

    Posted 21 Mar 2014 Link to this post

    I am trying to start a drag manually using DragDropManager.DoDragDrop – but do not have any success.

    Do you have a working example?

    /Flemming Rosenbrandt
  2. Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 24 Mar 2014 Link to this post

    Hello Flemming,

    I'm not sure if I understand correctly the requirements, however in order to start drag drop operation there should be a mouse interaction
    with the desired element. Firstly you will need to set the attached telerik:DragDropManager.AllowDrag property of the element in XAML and then to add DragInitialize handler in the code.

    As for the DoDragDrop method - it comes from the framework itself and you don't need to use it as it is already implemented in the methods of the DragDropManager (you can check the Events section of the DragDropManager online help documentation).

    Hope this helps. If you have any further questions let us know.

    Regards,
    Kalin
    Telerik
     

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

     
  3. DevCraft banner
  4. Flemming Rosenbrandt
    Flemming Rosenbrandt avatar
    119 posts
    Member since:
    Mar 2006

    Posted 24 Mar 2014 in reply to Kalin Link to this post

    I have normal drag drop working fine – but in some scenarios I want to start a drag without
    mouse interaction.

    I thought that this was what the DoDragDrop method was for?

    /Flemming Rosenbrandt

  5. Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 25 Mar 2014 Link to this post

    Hello Flemming,

    The DoDragDrop method is used in special scenarios, for example if you need to start the drag operation with some delay while keeping the mouse button pressed. However in order to be able to start a drag operation you will need mouse or touch interaction anyway. Could you please share some more detailed information about the exact requirements of your scenario and issues you are facing so we can provide you with an example solution?

    I'm looking forward to hearing from you.

    Regards,
    Kalin
    Telerik
     

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

     
  6. Flemming Rosenbrandt
    Flemming Rosenbrandt avatar
    119 posts
    Member since:
    Mar 2006

    Posted 26 Mar 2014 in reply to Kalin Link to this post

    I have a listbox with draggable graphic items in it. The items can be dropped on a design surface. It works fine. But for novice user I want them to be able to select an item – and then click an insert button. At this point I want to start a drag manually – so that the item is attached to the mouse and ready for a drop.

    /Flemming Rosenbrandt

  7. Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 27 Mar 2014 Link to this post

    Hi Flemming,

    You can achieve the desired, but the user should keep the mouse button pressed in order to continue the drag operation. We have created a sample project which demonstrates the exact approach - you will need to select an item in the first ListBox, press the button and while keeping the mouse left button down to start dragging the attached item.

    Hope this will help you to achieve the requirements.

    Regards,
    Kalin
    Telerik
     

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

     
Back to Top
DevCraft banner