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

Drag and Drop events in TreeListView

1 Answer 141 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Max
Top achievements
Rank 1
Max asked on 22 May 2013, 07:48 AM
Hi,

I'm trying to add drag and drop behavior to RadTreeListView like this:
        <Style TargetType="telerik:RadTreeViewItem" x:Key="TreeViewItemStyle">
            <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True" />
            <Setter Property="telerik:DragDropManager.AllowDrag" Value="True"/>
            <Setter Property="telerik:RadDragAndDropManager.AllowDrop" Value="True" />
        </Style>
....
 <telerik:RadTreeListView  x:Name="TestScriptTreeListView"
SelectedItem="{Binding TestViewItem.SelectedScriptActionViewItem, Mode=TwoWay}"  
ItemContainerStyle="{StaticResource TreeViewItemStyle}"
IsDragDropEnabled="True"
AllowDrop="True"
ItemsSource="{Binding Source={StaticResource scriptActionSorted}}"
behavior:TestScriptDragDropBehavior.UseTestScriptDragDrop="True"">

and in the behavior I tried to register to the events like this:
private static void StartUseDragDrop(RadTreeListView treeListView)
    {
      DragDropManager.AddDragInitializeHandler(treeListView, OnDragInitialize);
      DragDropManager.AddGiveFeedbackHandler(treeListView, OnGiveFeedback);
      DragDropManager.AddDropHandler(treeListView, OnDrop);
      DragDropManager.AddDragDropCompletedHandler(treeListView, OnDragDropCompleted);
      DragDropManager.AddDragOverHandler(treeListView, OnDragOver);
      //this is just to try and stop
      DragDropManager.AddPreviewDragEnterHandler(treeListView, DragEnter2);
      DragDropManager.AddPreviewDragOverHandler(treeListView, OnDragOver2);
      DragDropManager.AddPreviewDropHandler(treeListView, OnDrop2);
      DragDropManager.AddPreviewGiveFeedbackHandler(treeListView, OnGiveFeedback2);*/
       
    }

the problem is that the only events that are called are the preview events and no the actual regular events. The only event that is called is the "OnDragDropCompleted" event. how can i make it call the regular events also?


1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 24 May 2013, 02:43 PM
Hello Max,

From the provided code snippets I have noticed that you are using our RadTreeListView. I believe the problem is that your style is targeting RadTreeView.

Regards,
Yoan
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
TreeListView
Asked by
Max
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or