Re-use RadTreeListView DragCue

2 posts, 0 answers
  1. Arinto
    Arinto avatar
    25 posts
    Member since:
    Nov 2010

    Posted 28 Feb 2011 Link to this post

    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, 

  2. Tsvyatko
    Tsvyatko avatar
    858 posts

    Posted 01 Mar 2011 Link to this post

    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,
    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!
Back to Top