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

Drag/Drop doesn't work when TreeListView is in RadLayoutControl

1 Answer 99 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Non
Top achievements
Rank 1
Non asked on 27 Jul 2017, 11:14 AM

Hello,

I've implemented TreeViewDragDropBehavior for TreeListView by using the sample code from Telerik UI for WPF Demo and it's work.

But when I added the TreeListView into a RadControlLayout, drag/drop events seems stop working. TreeViewDragDropBehavior.OnDragInitialize was fired but nothing happed afterward.

Any workaround about this?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 31 Jul 2017, 12:53 PM
Hello Non,

The reported behavior appears because RadLayoutControl internally works with DragDropManager and it cancels the drag operation in certain cases. In order to prevent this you can handle the DragInitialize event fired by RadTreeListView. This way the drag/drop opeartion won't bubble to the layout control.
DragDropManager.AddDragInitializeHandler(this.treeListView, OnTreeListViewDragInitialize);

private void OnTreeListViewDragInitialize(object sender, DragInitializeEventArgs e)
{
    e.Handled = true;
}

I hope this helps.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
TreeListView
Asked by
Non
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or