Is there a "Delay" Parameter for Drag and Drop operations?

6 posts, 1 answers
  1. Todd Millett
    Todd Millett avatar
    115 posts
    Member since:
    Jul 2009

    Posted 02 Sep 2009 Link to this post

    I've been playing with the Drag and Drop API, and have been impressed with it's capabilities.  However, I have run into an issue that causes a bad user experience.

    I have a Silverlight 3 Datagrid with a custom style that shows checkboxes when the user selects a given row, rather than just highlighting the row.

    Clicking on the checkbox works just fine.  However, when I added the Drag and Drop capability from your library, as soon as I click on the checkbox, the application thinks a drag operation has begun, and the Drag cue and Arrow cue appear. 

    Is there some sort of delay parameter that can be set, so that we can tell the API not to initiate a Drag operation until the mouse key has been held down for a certain period of time?  In our case, I can click and let up on the mouse immediately, and it still starts a drag operation.  This only occurs if I click on my custom checkbox -- not when I click on other parts of the DataGrid row.

    I'd be happy to send a code sample if that would help.
  2. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 07 Sep 2009 Link to this post

    Hi Todd Millett,

    I am sorry for the delayed reply,

    Following your description I tried to recreate your scenario but it worked as expected on my side. I am attaching the project that I created to test this.

    The problem that you describe comes from the fact the CheckBox (and all other buttons) capture the mouse on MouseDown. We listen to the mouse events of the row but this does not work since the check box has captured the events from then on.

    Since this does not seem like an issue in my project, probably I am missing something. Could you have a look at it and modify it so that it breaks or, alternatively, modify your implementation so that it works similarly.

    Normally we should handle cases like this one, so I will be happy to patch the RadDragDrop to avoid acting unexpectedly.

    All the best,
    Miroslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Todd Millett
    Todd Millett avatar
    115 posts
    Member since:
    Jul 2009

    Posted 08 Sep 2009 Link to this post

    I have opened a support ticket and attached my sample code.  I am not using the RadGridView control as in your example.  I am using a standard Silverlight 3 DataGrid control, with my own custom style that causes checkboxes to only appear when the user mouses over a row, similar to the style available in Windows Vista and Windows 7. 

    As such, I believe the problem may be related to my custom style and the Drag Drop library.  Modifying your custom code would not expose the problem.
  5. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 09 Sep 2009 Link to this post

    Hi Todd Millett,

    You do actually say that you are using the SL 3 grid

    "...I have a Silverlight 3 Datagrid... "

    I am sorry that I overlooked this. Thanks for sending a ticket, I will have a look at it and reply here as well for anyone else that could run into this problem.

    Best wishes,
    Miroslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Answer
    Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 09 Sep 2009 Link to this post

    Hello Todd,

    I replied to your ticket as well -

    The problem was arising from the way the DragDrop currently works. Basically it got confused from objects that appear in front of the mouse during the in mouse down handler. This was due to an implementation detail that has been changed for the coming Beta release and onwards.

    Normally this can be fixed by setting the IsHitTestVisible property of the appearing object to false. Another option is to animate the Opacity rather than the Visibility of an object if the it is appearing as a part of a visual state.

    Thanks for your feedback,

    Sincerely yours,
    Miroslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Todd Millett
    Todd Millett avatar
    115 posts
    Member since:
    Jul 2009

    Posted 09 Sep 2009 Link to this post

    Thanks. Both of those approaches fixed the problem.
Back to Top
DevCraft banner