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

Mouse Event While Dragging

1 Answer 92 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Jaime Weise
Top achievements
Rank 1
Jaime Weise asked on 25 Jan 2011, 11:15 AM
Experimenting with the DragAndDropManager
I have been experimenting with the DragAndDropManager control I have several drag/drop targets are dynamically created. I have a listbox that is part of each of these drag/drop targets. When I populate the targets the listboxes are populated as well with data. That data is draggable to other listboxes in the other targets. This works fine when the listboxes contain data. However to conserve space I set the Visibility to Collapsed when the listboxes have no data in them. Since the listboxes are hidden I can nolonger drop anything on them.

My first couple stabs at a solution
There are various ways I have tried to solve this problem albeit unsuccessfully. The first was to create the Parent control as a drop target and then use FindControl to find the list and add the payload to the list. I don't know why this didn't work. The other and more visually attractive way would be to start dragging the the object and when the mouse rolls over the parent the ListBox becomes visible and thus I am able to drop data on top of it to populate it. 

Is the mouse event disabled while dragging?
If I can handle mouse events while dragging I can surely get this solved but it doesn't seem to work.

1 Answer, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 26 Jan 2011, 10:07 AM
Hi jwize,

Hi, indeed while dragging the mouse move event is suppressed. This is a common approach when performing drag drop operations. However, even if we did not do it the mouse move event is not raised for collapsed elements (as demonstrated for CollapsedTargetGrid in the attached project)

What I can suggest is to use zero opacity and reduced height(or width) to save space, while in the same way leaving area that is hittest visible. Then you can switch between hidden/shown state using the DragDrop events as show in the example. In addition this can be wrapped in two distinct states of the visual style manager of the listbox and just switch between them and providing ability to add transitions as well.

Best wishes,
Tsvyatko
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
DragAndDrop
Asked by
Jaime Weise
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Share this question
or