9 Answers, 1 is accepted
You can save a reference to the Visual in the DragInitialize event and use it later on for the Drag operation.
Hope this helps!
Nik
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Thanks,
Pavel.
When using our DragDropManager you can subscribe to the DragInitialize event. In its event handler you are allowed to set a DataTemplate (defined in your XAML) to the e.DragVisual property. When setting it you can save a reference to it like this:
private
var myDragVisual;
private
void
OnDragInitialize(
object
sender, DragInitializeEventArgs
{
...
myDragVisual =
new
ContentControl { ContentTemplate =
this
.Resources[
"MyDragCueTemplate"
]
as
DataTemplate };
e.DragVisual = myDragvisual;
...
}
For more information you can refer to our documentation or our online demonstration project.
Regards,
Pavel R. Pavlov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Exactly that cue that named as "TreeListViewDragCue" and placed in Telerik.Windows.Controls namespace.
Did you read it?
Thanks,
Pavel.
Do you get null values for the DragVisual when you start the drag from both TreeList and TreeView?
Looking forward to hearing from you!
Nik
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
I got null in both cases in both controls.
Even I do reordering in TreeListView. Visual feedback from drag'n'drop is presented, but still null in DragVisual.
Thanks,
Pavel.
I tested your scenario locally and get the same behavior. May I ask you to subscribe to the DragSterted events and see if you get null value there too?
Looking forward to hearing from you!
Nik
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
I use DragDropManager.
Thanks,
Pavel.
Unfortunately it turns out you cannot get the cue at the moment. We are going to investigate further and provide a fix as soon as possible.
As to updating states of the TreeListViewDragCue, we have fixed the problem regarding the cue not updating its states according to the drag effects, so now you can just set the DragEffects to none, for example, and the cue will reflect that change with the drop not allowed sign. The fix will be available with our next internal build.
Hope this helps!
Nik
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.