Hello Support,
I need to create tree view in my XamDataGrid where I can drag and drop child elements to other sections/elements of the tree view and I can also rename/edit elements of tree.
I have never used both TreeView and DragDrop before.
Can you please provide me a sample to start with? It will really help me.
Thanks in advance!
Priya
Hello Priya and thank you for posting!
I have been looking into your description and I will need a little further clarification to understand your scenario. Would you please let me know whether you are using the WPF TreeView (System.Windows.Controls.TreeView)? What do you mean by “create tree view in my XamDataGrid”?You can have a look at our online documentation for getting started with the Drag and Drop framework:http://help.infragistics.com/doc/WPF/2014.1/CLR4.0/?page=Drag_and_Drop_Framework_Getting_Started_with_IG_Drag_and_Drop_Framework.html
Hello Maria,
Sorry for causing confusion. I am creating a TreeView in WPF Grid.
I need to apply Drag-Drop and Edit features on all TreeViewItems. I should be able to Drag a child Item from one Parent and drop it into any of parent's sibling items.
I have 3 levels of items in my TreeView. And Drag-drop should be allowed only on same level.
Thanks,
Hello Priya,
I have created a sample project that shows how the Drag and Drop framework can be used to implement this functionality in the TreeView control. This logic is implemented for the root level of the tree and you could use this as basis to implement the functionality for the other levels too. When drag and drop channels are set the drag and drop actions are only available for elements within the same channel. In this case these are the items within the same level in the hierarchy. When the item is drop the source collection is modified to rearrange the items. I hope this is helpful for you. Please feel free to update the case if you have any other questions.
Thanks you for the sample project.
I have a question. Can we implement this same thing in XamdataGrid instead of normal grid?
If yes, then how?
Thanks & Regards,
The TreeView can be displayed in a XamDataGrid’s cell by modifying the default template of the cell for the field where you want the tree to be. I have created another sample for you that shows this approach. I hope it will be helpful for you.
Sorry for picking up the thread. We are looking similar functionality with these two additional features in the sample project given in this thread.
1. If the tree nodes span more than one page, when I drag to move up or down, I need the vertical scroll bar to move up or move down automatically
2. When I drop a node on another node, if that node is collapsed, I want that node automatically expand. Because my tree structure to too deep with many parents.
Please let me know if you can provide the sample with these feature.
Thanks in Advance.
Thank you for your feedback Priya. I am glad that this approach helped you.
Hi Maria,
Drag-drop is working fine now.
Thank you for your help.
Regards,
I am just checking your progress on the issue.
If you have any other questions on the matter, please feel free to ask.