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

Drag & Drop Effects

1 Answer 88 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Valéry
Top achievements
Rank 1
Valéry asked on 22 Mar 2012, 10:21 AM
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.

1 Answer, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 27 Mar 2012, 11:38 AM
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 >>
Tags
TreeView
Asked by
Valéry
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or