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

Source of ICollectionView, dropped item is not removed from source

3 Answers 83 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Gareth McNicol
Top achievements
Rank 1
Gareth McNicol asked on 21 Feb 2011, 03:05 PM
I have adapted the Drag & Drop from Listbox example that is provided in the demos.

The only changes that I have made are:
* A custom override of Appointment, with deep copying implemented with Copy and CopyFrom and the Storage<T> method employed.
* Altered to foreach in CreateDragCue to ensure the appointment is 1 day long.
* The source collection is an ICollectionView

Putting a Breakpoint at the start of OnDropInfo in the ListboxDragDropBehaviour  with a condition of "When Hit..." and printing the e.Options.Status, the last status is DropImpossible. Never DropComplete.  Now, this is on the Listbox.

Is there anyway to override the OnDropInfo on the ScheduleView so I can work round the fact that the ICollectionView is not updated as it should be? 

Is the fact the source collection is not updated to have the dragged item(s) removed on being dropped from an ICollectionView onto the ScheduleView a bug?

If so, will it be fixed?

If so, when?

3 Answers, 1 is accepted

Sort by
0
Gareth McNicol
Top achievements
Rank 1
answered on 21 Feb 2011, 05:05 PM
Update:

I have attempted to remove from the ICollectionView's source manually by Listening to the destination collections "CollectionChanged" event.

However, The list of Appointments has none of the Source Appointment's information, even the UniqueId is different. 

Can I get an answer on this?
0
Gareth McNicol
Top achievements
Rank 1
answered on 24 Feb 2011, 11:14 AM
The work around for this is horrendous.

Listen for collection change on the target collection.
For each of the dropped Appointments listen to their OnPropertyChanged.
When the UniqueId property is changed, unsubscribe to the propertychanged event then remove the item from the Source list with the same UniqueId property.

This is using the two events in ways that they weren't intended to be used.  I don't know what I'll have to do if I need to start listening for other properties and handling other events on the Target collection further down the line.

The lack of response to this is deafening.
0
George
Telerik team
answered on 24 Feb 2011, 02:56 PM
Hello Gareth,

 
Please excuse me for the late reply.

Could you try our last internal build or the Q1 2011 Beta release? If the issue persists, could you please send us a sample project that reproduces the problem. It would be of great help for further pinpointing the problem.

Kind regards,
George
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
ScheduleView
Asked by
Gareth McNicol
Top achievements
Rank 1
Answers by
Gareth McNicol
Top achievements
Rank 1
George
Telerik team
Share this question
or