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

Re-use RadTreeListView DragCue

1 Answer 47 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Arinto
Top achievements
Rank 1
Arinto asked on 28 Feb 2011, 05:18 PM
Hi there, 

I have implemented Drag and Drop using RadDragAndDropManager. And in order to make the DragCue consistent with RadTreeListView, I would like to re-use RadTreeListView's DragCue since I use Drag and Drop capability in RadTreeListView.

so, how can I achieve that?
So far I've done this:
ContentControl dragCue = RadDragAndDropManager.GenerateVisualCue();
dragCue.Content = draggedItem.DataContext;
dragCue.ContentTemplate = this.Resources["DragCueTemplate"] as DataTemplate;
e.Options.DragCue = dragCue;

But, the appearance is still different with RadTreeListView.

Thanks and best regards, 

Arinto

1 Answer, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 01 Mar 2011, 11:36 AM
Hello Arinto,

You can create instance of TreeListViewDragCue and set the current drag cue:
e.Options.DragCue = dragCue;

In order to set the correct content you need to assign its ItemsSource  e.g.
dragCue.ItemsSource = new List<object>{draggedItem.DataContext};


Best wishes,
Tsvyatko
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
DragAndDrop
Asked by
Arinto
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Share this question
or