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

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

5 Answers 123 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Todd Millett
Top achievements
Rank 1
Todd Millett asked on 02 Sep 2009, 04:35 PM
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.

5 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 07 Sep 2009, 12:27 PM
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.
0
Todd Millett
Top achievements
Rank 1
answered on 08 Sep 2009, 04:56 PM
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.
0
Miroslav
Telerik team
answered on 09 Sep 2009, 07:07 AM
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.
0
Accepted
Miroslav
Telerik team
answered on 09 Sep 2009, 07:31 AM
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.
0
Todd Millett
Top achievements
Rank 1
answered on 09 Sep 2009, 03:49 PM
Thanks. Both of those approaches fixed the problem.
Tags
DragAndDrop
Asked by
Todd Millett
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Todd Millett
Top achievements
Rank 1
Share this question
or