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

DrageAndDrop then update object data

1 Answer 44 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Pratt
Top achievements
Rank 1
Pratt asked on 09 Jan 2015, 08:26 PM
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?

1 Answer, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 14 Jan 2015, 02:57 PM
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.

 
Tags
DragAndDrop
Asked by
Pratt
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Share this question
or