I am trying to make the last item only dragable to a scheduler control. For the most part I have everything working, except the drag and drop. My treeView code is as followed:
<ig:XamTree x:Name="dataTree" Grid.Column="0" BorderThickness="0,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="#FFFFFFFF" ItemsSource="{Binding Source={StaticResource ViewModel}, Path=TreeDepartments}" IsDraggable="True">
<ig:XamTree.HierarchicalItemTemplate>
<ig:HierarchicalDataTemplate ItemsSource="{Binding TimeAreas}">
<DataTemplate>
<TextBlock FontWeight="Bold" Text="{Binding Name}" />
</DataTemplate>
<ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
<ig:HierarchicalDataTemplate ItemsSource="{Binding TimeTasks}">
<TextBlock Text="{Binding Name}" />
<ig:HierarchicalDataTemplate ItemsSource="{Binding TimeSubTasks}">
<ig:HierarchicalDataTemplate>
<DataTemplate >
<TextBlock Text="{Binding Name}">
<ig:DragDropManager.DragSource>
<ig:DragSource x:Name="treeDragSource" IsDraggable="True" DragChannels="ChannelB" Drop="treeDragSource_Drop"></ig:DragSource>
</ig:DragDropManager.DragSource>
</TextBlock>
</ig:HierarchicalDataTemplate>
</ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
</ig:XamTree.HierarchicalItemTemplate>
</ig:XamTree>
As you may notice the dragdropManager is on the textblock which isnt what I need. I need to be able to retrieve the whole tree of the item they are dragging. So somehow in the drop event I need the selected items parents information or equivalent of it.
I had this working before but on the xamtreeitem for example:
<
ig:XamTree x:Name="dataTree" Grid.Column="0" BorderThickness="0,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="#FFFFFFFF" ItemsSource="{Binding Source={StaticResource ViewModel}, Path=TreeDepartments}" IsDraggable="True">
="True">
="Financial Programs">
="Calculator">
>
="Photo Editor"/>
Any Ideas how to get the hierarchy to work simularly as the tree item?
Hello,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
I just need the last node only to be draggable to a scheduler component. Instead of all branches of a tree. I fixed by filtering the type of the objects on the drop event. This worked for my needs.
var treeview = (DragSource)sender;
if(!(treeview.DataObject is TimeManagement.Model.TaskSubTask)){return;}
Thanks
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into your post, but it seems like am missing something about your scenario, so if this is still an issue for you, could you please send me an isolated sample project, where this is reproduced, so I can investigate it further for you.
Feel free to write me if you have further questions.