Hello,
I am using MVVM to implement my Drag and Drop in my TreeView. I am using eventtrigger to bind my command when
DragEnd event takes place. In Viewmodel, when the command calls my update method to call the appropriate service. But my issue is figuring out the previous and the new parent of the child/node/radtreviewitem that had been dragged and dropped. So that when i call my service I can tell what parent child is being deleted and which parent is getting a new child. I hope i am making sense here and your help ASAP is very much appreciated.
I am attaching sample of my code. Hope this helps. Thank You very much.
<
telerik:RadTreeView
x:Name
=
"tlrkTree"
ItemsSource
=
"{Binding TreeData, Mode=TwoWay}"
BorderBrush
=
"Gray"
BorderThickness
=
"1"
Grid.Row
=
"2"
ItemContainerStyle
=
"{StaticResource RadTreeViewStyle}"
Width
=
"Auto"
Height
=
"400"
Margin
=
"2,2,2,2"
IsDragDropEnabled
=
"True"
IsDragTooltipEnabled
=
"True"
IsDropPreviewLineEnabled
=
"True"
SelectedItem
=
"{Binding SelectedTreeNode, Mode=TwoWay}"
>
<
i:Interaction.Triggers
>
<
i:EventTrigger
EventName
=
"DragEnded"
>
<
i:InvokeCommandAction
Command
=
"{Binding DragEndCommand}"
CommandParameter
=
"{Binding}"
/>
</
i:EventTrigger
>
</
i:Interaction.Triggers
>
<
telerik:RadTreeView.ItemTemplate
>
<
telerik:HierarchicalDataTemplate
ItemsSource
=
"{Binding Children}"
>
<
StackPanel
>
<
TextBlock
x:Name
=
"textBlock"
>
<
Run
Text
=
"{Binding Name, Mode=TwoWay}"
/>
</
TextBlock
>
</
StackPanel
>
</
telerik:HierarchicalDataTemplate
>
</
telerik:RadTreeView.ItemTemplate
>
</
telerik:RadTreeView
>
Thank You in advance,