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

TreeViewDragCue via DragDropManager.

9 Answers 102 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Pavel
Top achievements
Rank 1
Pavel asked on 02 Apr 2013, 10:53 AM
I'm dragging item from TreeView to TreeListView and want to update TreeViewDragCue dynamicly to set its' IsDropPossible property. 
How can I get an object of it?
Thanks,
Pavel.

9 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 02 Apr 2013, 01:37 PM
Hi Pavel,

You can save a reference to the Visual in the DragInitialize event and use it later on for the Drag operation.

Hope this helps! 

Regards,
Nik
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Pavel
Top achievements
Rank 1
answered on 02 Apr 2013, 02:15 PM
But where can I get it? DragVisual is null. 
Thanks,
Pavel.
0
Pavel R. Pavlov
Telerik team
answered on 05 Apr 2013, 08:30 AM
Hello 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;
    ...
}
By doing so you will be able to modify your visual later on.

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.

0
Pavel
Top achievements
Rank 1
answered on 09 Apr 2013, 09:02 AM
Ok, you right, but I asked about how can I get Cue that automaticly setted by treelistview? 
Exactly that cue that named as "TreeListViewDragCue" and placed in Telerik.Windows.Controls namespace.
Did you read it? 
Thanks, 
Pavel.
0
Nick
Telerik team
answered on 10 Apr 2013, 02:29 PM
Hi 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! 

All the best,
Nik
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Pavel
Top achievements
Rank 1
answered on 10 Apr 2013, 07:04 PM
Hello Nik,
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.
0
Nick
Telerik team
answered on 11 Apr 2013, 11:16 AM
Hello 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! 

Kind regards,
Nik
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Pavel
Top achievements
Rank 1
answered on 15 Apr 2013, 07:16 AM
I have no idea where can I find this event. 
I use DragDropManager.
Thanks,
Pavel.
0
Nick
Telerik team
answered on 17 Apr 2013, 07:53 AM
Hi 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! 

Regards,
Nik
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
DragAndDrop
Asked by
Pavel
Top achievements
Rank 1
Answers by
Nick
Telerik team
Pavel
Top achievements
Rank 1
Pavel R. Pavlov
Telerik team
Share this question
or