Hi.
I have looked at the following post but it is not doing what I want.
http://ko.infragistics.com/community/forums/p/72171/365708.aspx#365708
I am trying to allow nodes in a XamDataTree, either parent or child to be dragged to another control, such as a standard WPF ListBox. So far we have tried:
I think I've got it working... I added a DropTarget object to each of my text boxes and that seems to have fixed the majority of issues. Note that at this point, my XamDataTree does NOT have a DropSource object.
There is still an issue I'd like to resolve: I'd like to change the mouse cursor from the red "X" whenever a list item has been dragged over a valid text editor. At this point, the cursor remains "X".
Thanks.
Working xaml:
<igEditors:XamTextEditor x:Name="txtProducedByFermentation" Text="{Binding Attribute1}" Margin="2" Height="24" Width="150" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" VerticalContentAlignment="Center" AllowDrop="True">
<ig:DragDropManager.DropTarget>
<ig:DropTarget IsDropTarget="True"/> </ig:DragDropManager.DropTarget> </igEditors:XamTextEditor>
I'm trying to do basically the same thing, only dragging a node from a XamDataTree to a XamTextEditor. Sample program works. The XamDataTree_NodeDragDrop doesn't fire (unless I enable and drag and drop within the XamDataTree, which I don't want). Here is my xaml:
<igEditors:XamTextEditor x:Name="txtProducedByFermentation" Margin="2" Height="24" Width="150" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" VerticalContentAlignment="Center" AllowDrop="True"/>
<ig:XamDataTree Grid.Row="0" Grid.Column="2" HorizontalAlignment="Stretch" MinWidth="200" Grid.RowSpan="7" VerticalAlignment="Top" ItemsSource=" {Binding AttributeViewModels}" NodeDragDrop="XamDataTree_NodeDragDrop"><ig:XamDataTree.GlobalNodeLayouts> <ig:NodeLayout Key="ChildAttributes" TargetTypeName="AttributeViewModel" DisplayMemberPath="AttributeID" IsExpandedMemberPath="AttributeIsExpanded" IsDraggable="True" IsDropTarget="False"/> </ig:XamDataTree.GlobalNodeLayouts> </ig:XamDataTree>
Any help is appreciated.
Hello Ofer,
Thank you for your post. I have been looking into it and I modified the sample Matt uploaded, so now it has the functionality you want. Basically I created an ItemTemplate for the ListBox and make the TextBlock inside draggable. This way I was able to drag it and drop it in the XamDataTree. I also add a check in the XamDataTree's NodeDrop event handler to see if the DropTarget is ListBox and if not I let the XamDataTree make its built in DragDrop of Nodes.
Hi
I need to have Drag and Drop functionality between a XamDataTree and another control (e.g. ListBox) in both directions as well as WITHIN the XamDataTree.
When playing with the sample provided in this thread i could always get some of the dragging working but not all of them.
Would it be possible to extend this demo so that dragging is enabled in both ways and also within the tree?
Thanks,
HI,
Please let me know if you need further assistance regarding this issue.