Drag & Drop Effects

2 posts, 1 answers
  1. Valéry
    Valéry avatar
    2 posts
    Member since:
    Feb 2012

    Posted 22 Mar 2012 Link to this post

    Hello,

    I'm evaluating the TreeView of "RadControls for WPF Q3 2011 SP1" on Windows 7.
    I'm using the version 2011.3.1220.40 of Telerik.Windows.Controls.Navigation.

    I want to use the drag and drop capabilities of the TreeView.
    But it seems that the property Effects of the DragDropEventArgs object is always null.

    public TelerikTreeview()
    {
      InitializeComponent();
      RadDragAndDropManager.AddDropQueryHandler(m_cellTreeView, new EventHandler<DragDropQueryEventArgs>(OnDropQuery));
    }
     
    private void OnDropQuery(object sender, DragDropQueryEventArgs e)
    {
      System.Diagnostics.Debug.WriteLine(e.Options.Effects);
    }

    How do you perform a copy or move operation with your drag & drop ?

    Best regards.
  2. Answer
    Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 27 Mar 2012 Link to this post

    Hello,

    This property is not used internally by the TreeView. Currently the default behavior is Move and, there is no easy way to customize the drag and drop to support move scenario. You should handle the RadDragAndDropManager.DragInfoEvent event on the SOURCE TreeView when DragDropEvents.Option.Status is DragStatus.DragComplete. This should prevent the source TreeView from removing dragged item from its collection.
    You could register handler for DragInfoEvent for every TreeViewItem in the ItemPrepared event or use the EventManager.RegisterClassHandler(typeof(RadTreeViewItem)...) syntax.

    Hope this helps. Please let us know if you need more info on the topic.

    Kind regards,
    Hristo
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top