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

RadListBox dragging without removing element problem.

5 Answers 164 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.
Clint Singer
Top achievements
Rank 1
Clint Singer asked on 13 Apr 2012, 05:20 PM
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

5 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 17 Apr 2012, 09:43 AM
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 >>

0
Clint Singer
Top achievements
Rank 1
answered on 19 Apr 2012, 06:37 PM
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
0
Nick
Telerik team
answered on 24 Apr 2012, 04:22 PM
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 >>

0
Clint Singer
Top achievements
Rank 1
answered on 24 Apr 2012, 04:39 PM
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
0
Nick
Telerik team
answered on 26 Apr 2012, 08:58 AM
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 >>

Tags
DragAndDrop
Asked by
Clint Singer
Top achievements
Rank 1
Answers by
Nick
Telerik team
Clint Singer
Top achievements
Rank 1
Share this question
or