RadListBox dragging without removing element problem.

6 posts, 0 answers
  1. Clint Singer
    Clint Singer avatar
    133 posts
    Member since:
    Oct 2012

    Posted 13 Apr 2012 Link to this post

    Hi,

    I am trying my hand with the drag and drop from one RadListBox to another but I don't want to remove the element from the origin listbox.  I created a new class using ListBoxDragDropBehavior as my base class where I overloaded the DragDropCompleted to not call the RemoveItems() method.

    When I use this, while I get the dragging behavior that I expected, the ListBoxes end up with rows where the Selected state isn't cleared on either listbox.  I then end up with a number of rows that still have their highlight showing until I drag my mouse over them.

    Is there a recommended way to cleanly support what I want?  I am either doing it wrong or this is a bug.

    Cheers,
    Clint
  2. Nick
    Admin
    Nick avatar
    593 posts

    Posted 17 Apr 2012 Link to this post

    Hi Clint,

    You can override the CopyDraggedItems method in the derived ListBoxDragDropBehavior. In cases where you don't remove the dragged items from the Source there could be problems related to the fact that many controls hold instances of the same object more than once. 

    Hope this helps! 

    All the best,
    Nik
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Clint Singer
    Clint Singer avatar
    133 posts
    Member since:
    Oct 2012

    Posted 19 Apr 2012 Link to this post

    Hi,

    I just noticed that the Silverlight example of RadDiagram also suffers from the same problem. When I hover on a shape, say Ellipse, it is highlighted and stays highlighed as I click and drag the element.  When I drop it on the Diagram surface the highlight isn't cleared even if I mouse over another item in the Toolbox.  It doesn't clear until I enter and leave the Ellipse item again.  

    This is same problem I was describing so it appears to be a systemic problem with the way the drag and drop interacts with controls that have selection.

    Cheers,
    Clint
  5. Nick
    Admin
    Nick avatar
    593 posts

    Posted 24 Apr 2012 Link to this post

    Hello Clint,

    It seems it is a problem in the visual states of the elements in Silverlight. We haven't been able to reproduce the issue in Silverlight. It would be great if you could provide a sample project that replicates the issue in other controls besides the ListBox.

    Thank you in advance! 

    Regards,
    Nik
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Clint Singer
    Clint Singer avatar
    133 posts
    Member since:
    Oct 2012

    Posted 24 Apr 2012 Link to this post

    Hi,

    You can see the problem in action on the online RadDiagram Silverlight example. 

    1) Just click on one of the shapes and drag it out on to the diagram surface. 
    2) You will see that the shape still has it's hover/selected still visible.
    3) Click on another shape and drag it without mousing over the first one.
    4) You will see that both of the shapes are still highlighted.
    5) Repeat for other items.

    When you don't remove items from a ListBox you get the same experience.

    Cheers,
    Clint
  7. Nick
    Admin
    Nick avatar
    593 posts

    Posted 26 Apr 2012 Link to this post

    Hi Clint,

    Actually the container where the shapes are contained is a ListBox. Nevertheless, we have isolated the issue. It turned out to be a problem in the mouse capture in the dragged element and changing it's visual states. 
    A fix will be available in our next internal build! 

    Hope this helps! 

    Greetings,
    Nik
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
DevCraft banner