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

How to cancel drop in handler specified by AddDropInfoHandler method

3 Answers 56 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Rod Yager
Top achievements
Rank 1
Rod Yager asked on 22 Dec 2010, 11:12 PM
When DragComplete status is hit in my DropInfo handler, I want to update something in the DB. If that fails, I would like the appointment drop to be canceled. How can I achieve this?

Thanks,
Rod

3 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 29 Dec 2010, 11:01 AM
Hello Rod,

I would suggest you to refer to our online documentation - http://www.telerik.com/help/wpf/raddraganddrop-howto-delayed-dragdrop.html

I hope this suits your needs.

Kind regards,
George
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Rod Yager
Top achievements
Rank 1
answered on 03 Jan 2011, 05:37 PM
I tried this example and it is not working for me. My scheduleview has an AppointmentSource set to an ObservableAppointmentCollection. The Appointment gets added to the scheduleview even when it doesn't get added via the delayedDragDrop.DropAction
 
delayedDragDrop.DropAction = () =>
                {
                    taskAppointments.Add(mta);
                };
  
                IList selectedItems = delayedDragDrop.DragDropState.Data as IList;
                foreach (DataRowView drv in selectedItems)
                {
                    ObservableCollection<object> resources = delayedDragDrop.DragDropState.DestinationSlots.First().Resources;
                    if (resources.Count == 1)
                    {
                        mta = delayedDragDrop.Appointment as MetrixTaskAppointment;
                        PersonResource resource = resources[0] as PersonResource;
                        string personId = resource.PersonId;
                        DateTime slotStart = delayedDragDrop.DragDropState.DestinationSlots.First().Start;
  
                        if (personId.Length > 0 && mta != null)
                        {
                            if (UpdateTaskAndUnit(personId, mta, slotStart))
                            {
                                removeObjects.Add(drv);
                                delayedDragDrop.DropAction();
                            }
                                       else
                                       {
                                           The Appointment is still being rendered on the ScheduleView
                                           even though I have not added it to the AppointmentSource 
                                           collection.
                                       }     
                        }
                    }
                }
0
George
Telerik team
answered on 06 Jan 2011, 10:24 AM
Hello Rod,

Could you please give us more detailed information about your scenario? Do you drag and drop appointments only inside the RadScheduleView or you drag them from an external source? If you send us a sample application that reproduces the problem it would be very helpful. 

 

Regards,
George
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
Tags
ScheduleView
Asked by
Rod Yager
Top achievements
Rank 1
Answers by
George
Telerik team
Rod Yager
Top achievements
Rank 1
Share this question
or