Drag and Drop to to do assignments

4 posts, 0 answers
  1. Brian D
    Brian D avatar
    9 posts
    Member since:
    Jan 2007

    Posted 19 Sep 2012 Link to this post

    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.

  2. Nick
    Admin
    Nick avatar
    593 posts

    Posted 20 Sep 2012 Link to this post

    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.

  3. DevCraft banner
  4. Brian D
    Brian D avatar
    9 posts
    Member since:
    Jan 2007

    Posted 20 Sep 2012 Link to this post

    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.
  5. Nick
    Admin
    Nick avatar
    593 posts

    Posted 24 Sep 2012 Link to this post

    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.

Back to Top