Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > DragAndDrop > Drag and drop from rad grid view to scheduler

Not answered Drag and drop from rad grid view to scheduler

Feed from this thread
  • bonDaviD avatar

    Posted on Nov 24, 2011 (permalink)

    Hi,

    I am trying to implement the drag and drop functionality between the RadScheduleView and listbox. I have followed the samples provided by telerik to implement the task. I have a converter named "ScheduleViewToAppointmentConverter" and also ScheduleVIewDragDropBehaviour class to implement the cusotom drag drop behaviour. In the Beaviour class i have override the Drop method and add it to the destination source . The code snippet for the behaviour class is as follow . Here eventhogh i get the dragged data in the drop menthod i coudnt communicate with the view model.

    public class ScheduleViewDragDropBehavior : Telerik.Windows.Controls.ScheduleViewDragDropBehavior
       {
           public override IEnumerable<IOccurrence> ConvertDraggedData(object data)
           {
               if (DataObjectHelper.GetDataPresent(data, typeof(Deal), false))
               {
                   return ((IEnumerable)DataObjectHelper.GetData(data, typeof(Deal), false)).OfType<IOccurrence>();
               }
               return base.ConvertDraggedData(data);
           }
     
     
           public override void Drop(Telerik.Windows.Controls.DragDropState state)
           {
               if (state.SourceAppointmentsSource == state.DestinationAppointmentsSource)
               {
                   base.Drop(state);
               }
               else
               {
                   var appointmentToAdd = state.Appointment as Deal;
                   appointmentToAdd.Subject = "Boney";
                   appointmentToAdd.Start = state.DestinationSlots.First().Start;
                   appointmentToAdd.End = state.DestinationSlots.First().End;
                   (state.DestinationAppointmentsSource as ObservableCollection<Deal>).Add(appointmentToAdd);
               }
           }
            
       }

    Here deal is the custom appointment class.

    Now i want to implement the drag and drop through commands, so that i can get the dragged data in the view model itself and hence i can add it the itemsource for the schedule view and i am planning to implement the validations too. How can i implement the drag and drop though commands. Any suggestions please.


    An help will be greatly appreciated.

    Thanks in advance.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > DragAndDrop > Drag and drop from rad grid view to scheduler
Related resources for "Drag and drop from rad grid view to scheduler"

Silverlight DragAndDrop Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]