Mouse Event While Dragging

2 posts, 0 answers
  1. Jaime Weise
    Jaime Weise avatar
    25 posts
    Member since:
    Nov 2008

    Posted 25 Jan 2011 Link to this post

    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.
  2. Tsvyatko
    Tsvyatko avatar
    832 posts

    Posted 26 Jan 2011 Link to this post

    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,
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
Back to Top