Hi.
I have a drag drop setup between a RadListBoxA (type A objects) and a ScheduleView(Appointments)
I use OnDragInitialize on the ListBox like this:
In the schedule view I use ScheduleViewLevel1DragDropBehavior : ScheduleViewDragDropBehavior.
In the public override bool CanDrop(DragDropState state) the state.DraggedAppointments shows the appointments , so it all works.
I will point out here that DragDropState is in fact for this converter an Telerik.Windows.Controls.DragDropState.
THE PROBLEM
Now I have to enable that the objects from RadListBoxA( Type A ) can also be dropped in another RadListBoxB (type B)
RadListBoxB already has dragging enabled from other sources , so it uses a SchematicViewListBoxDragDropBehavior : ListBoxDragDropBehavior
What I noticed is that in the override of CanDrop(DragDropState state) , DragDropState type comes from another namespace: Telerik.Windows.DragDrop.Behaviors.DragDropState
Whenever I drag something from RadListBoxA to RadListBoxB the state.DraggedItems has no elements.
I thought of using the payload.SetData on the ScheduleViewDragDropPayload to attach extra data , but it doesn't implement that , as it seems it's a different kind of payload than the ones used in other documentation , for example this:
Any suggestions would be much welcome. I'm hoping there is a way of doing it without having to rewrite the whole DragAndDrop between all the other controls that are already working nicely.
Thank you
I have a drag drop setup between a RadListBoxA (type A objects) and a ScheduleView(Appointments)
I use OnDragInitialize on the ListBox like this:
private void OnDragInitialize(object sender, DragInitializeEventArgs args)
{
var leg = ((sender as ContentControl).Content as TransportOrderLegViewModel);
// Convert Data to ScheduleView Payload
var appt = new Appointment() { };
if (leg.Planned)
{
appt.Location = "Test";
}
var payload = new ScheduleViewDragDropPayload(null, new List<
IOccurrence
>() { appt });
args.Data = payload;
// Create DragVisual
var cc = new ContentControl();
cc.ContentTemplate = Resources.MergedDictionaries[2]["TOLDragVisualTemplate"] as DataTemplate;
cc.Content = leg;
args.DragVisual = cc;
args.AllowedEffects = DragDropEffects.All;
args.DragVisualOffset = args.RelativeStartPoint;
args.Handled = true;
}
In the public override bool CanDrop(DragDropState state) the state.DraggedAppointments shows the appointments , so it all works.
I will point out here that DragDropState is in fact for this converter an Telerik.Windows.Controls.DragDropState.
THE PROBLEM
Now I have to enable that the objects from RadListBoxA( Type A ) can also be dropped in another RadListBoxB (type B)
RadListBoxB already has dragging enabled from other sources , so it uses a SchematicViewListBoxDragDropBehavior : ListBoxDragDropBehavior
What I noticed is that in the override of CanDrop(DragDropState state) , DragDropState type comes from another namespace: Telerik.Windows.DragDrop.Behaviors.DragDropState
Whenever I drag something from RadListBoxA to RadListBoxB the state.DraggedItems has no elements.
I thought of using the payload.SetData on the ScheduleViewDragDropPayload to attach extra data , but it doesn't implement that , as it seems it's a different kind of payload than the ones used in other documentation , for example this:
var payload = DragDropPayloadManager.GeneratePayload(null);
var data = ((FrameworkElement)args.OriginalSource).DataContext;
payload.SetData("DragData", data);
args.Data = payload;
Any suggestions would be much welcome. I'm hoping there is a way of doing it without having to rewrite the whole DragAndDrop between all the other controls that are already working nicely.
Thank you