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

Drag and Drop to to do assignments

3 Answers 26 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Brian D
Top achievements
Rank 2
Brian D asked on 19 Sep 2012, 03:08 PM

I am having the hardest time to get drag and drop working for doing assignments. Here is basically what we have:
1) A listbox of objects that display a name and a person assigned to them in a custom template
 - The object can have only up to 1 person assigned to it
2) A listbox of people

What I need to be able to do:
1) Drag a person from the list of people and drop it on an object to assign the person to the object.
2) I also need the ViewModel notified of the assignment. We use caliburn micro.

Every time I tried to do this with assignments using the DragDropManager I get a DropStatus of DropImpossible instead of DropComplete.

3 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 20 Sep 2012, 08:41 AM
Hi Brian,

Could you elaborate a little bit more about your approach to the solution? Which manager are you using to achieve the functionality (RadDragAndDropManager or DragDropManager), what settings have you set on the draggable and droppable objects? 

Looking forward to hearing from you! 

Greetings,
Nik
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Brian D
Top achievements
Rank 2
answered on 20 Sep 2012, 02:24 PM
I was using the RadDragAndDropManager, based on the examples MVVMLight3 and MVVMLight2 in the forum thread: http://www.telerik.com/community/forums/wpf/draganddrop/drag-drop-mvvm.aspx

1) On the listbox of people I had set the RadDragAndDropManager.AllowDrag to true on the listbox item style.
2) For the list of objects that people can be assigned to I put the RadDragAndDropManager.AllowDrop to true on the custom data template. 3) When handling the DragQuery event of the listbox item I was making sure to set the QueryResult in the DragDropQueryEventArgs to true.

Overall I would probably have preferred to use the DragDropManager, but could not find any examples that allowed me to notify the ViewModel.
0
Nick
Telerik team
answered on 24 Sep 2012, 11:41 AM
Hi Brian,

Unfortunately we don't have any examples that show the same approach with DragDropManager, however you should be able to implement the same for it, analogically. 

Let me know if you have difficulties while doing so. 

Greetings,
Nik
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Tags
DragAndDrop
Asked by
Brian D
Top achievements
Rank 2
Answers by
Nick
Telerik team
Brian D
Top achievements
Rank 2
Share this question
or