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

RadTreeView - Customize Drag Preview image

2 Answers 74 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 24 Jun 2014, 01:06 PM
Is there anyway to customize a DragPreview in WPF when using Telerik RadTreeView?

I've set  
IsDragPreviewEnabled="True"
but all that does is display the namespace in a button rather than a preview of the actual item being dragged (which in this case is a row of a grid)

Idon't necessarily need show a preview of the row I'm dragging - it would be good enough to show a standard image, just to give the user some feedback that the drag was taking place.</p>

Any ideas how I could achieve this?

Thanks

2 Answers, 1 is accepted

Sort by
0
Ian
Top achievements
Rank 1
answered on 24 Jun 2014, 03:28 PM
Ok, I'm seeing that using the DragInfo method might allow me to change the drag image.  I feel like I'm getting closer... :)
0
Evgenia
Telerik team
answered on 27 Jun 2014, 07:29 AM
Hello Ian,

Let me update you with the recent changes regarding the RadTreeView control.

During the last year we did some improvements in the built-in drag&drop logic of the control. Until now the control supported two drag drop managers to handle the corresponding commands through the attached property telerik:TreeViewSettings.DragDropExecutionMode, which allows users to switch between both managers. The New setting corresponds to the DragDropManager while the Legacy setting turns on the obsolete RadDragAndDropManager.
In our latest official release (Q2 2014) the default setting of the attached property is New. This means that by default the DragDropManager will be activated. 

You might tweak what gets visualized when you DragDrop via several properties we provided (you might find more information about them in our documentation). What I suggest is that you turn off the DragPreview Visibility and leave only the DragPreviewLine and DragTooltip:

<telerik:RadTreeView IsLineEnabled="True" telerik:TreeViewSettings.DragDropExecutionMode="New"
                                                 Width="250" IsRootLinesEnabled="True"      HorizontalContentAlignment="Stretch"
                                                 IsDragDropEnabled="True"
                                                 IsDragPreviewEnabled="False"
                                                 IsDragTooltipEnabled="True"
                                                 IsDropPreviewLineEnabled="True">
.....
</telerik:RadTreeView>

I attached a sample image demonstrating the result. Let me know how this works for you and whether you need any further customization.

Regards,
Evgenia
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
General Discussions
Asked by
Ian
Top achievements
Rank 1
Answers by
Ian
Top achievements
Rank 1
Evgenia
Telerik team
Share this question
or