DrageAndDrop then update object data

2 posts, 0 answers
  1. Pratt
    Pratt avatar
    1 posts
    Member since:
    May 2014

    Posted 09 Jan 2015 Link to this post

    I have an collection of Employee objects who have a collection of Assignment objects as a property.  The Assignment object has an Employee object property.

    I have another collection of "Unassigned" Assignments.

    UI-wise I want to drag and drop from the Unassigned RadListBox to the assignment RadListBox of an Employee.

    I have the drag and drop down. What I am missing is updating the Assignment.Employee property after an Assignment is dropped into the Employee.Assignments collection.  I have looked at overriding the DragDropBehavior,  but I do not see a way of accessing the data object that contains the DestinationItemsSource.

    Help?
  2. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 14 Jan 2015 Link to this post

    Hello Pratt,

    You should be able to achieve the desired using a custom ListBoxDragDropBehavior. You will need to override the DragDropCompleted and can access the just dropped item through the DragDropState - in state.DraggedItems property and modify it as required. Give it a try let us know if it helped.

    Hope this will work for you.

    Regards,
    Kalin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top