Is this possible to do with a standard implementation? User should be able to select several nodes and move them from their parent node somewhere else with one drag & drop operation. I have 2 types of nodes, it's basically accounts and groups of accounts (and groups) and sometimes a reorganisation of the structure is needed. The application will check if the result would still be a tree after the drop, of course. I set NodeSelection="Multiple", but when I make a multi selection and start dragging it, only one node stays selected. Is that possible to do at all? What would be a recommended way to accomplish this with as much standard code as possible? Thanks.
Ivan
Hello Ivan,
Thank you for your feedback. I believe that other community members may benefit from this as well.
Thanks again.
Hi Stefan,
I posted something, but I am not spending much time on it, I need the solution now. And I got one :) I describe it quickly, maybe somebody will benefit from it. I derived from XamDataTree and added OnPreviewMouseLeftButtonDown where I put a collection SelectionSettings.SelectedNodes on the side to use later (it's modified after the click is finished). After some checks of the selection's integrity I allow/don't allow the drag operation later. I also define DragTemplate to distinguish the standard and multi case. In callbacks for dragging & dropping I always use the stored collection. It works pretty nicely. The only part that is not nice are checks of the integrity of the tree after drop would be executed. I have a source code of the XamDatTree and there are some useful methods that are internal/private or use such classes, so I cannot check much. So the checks are mostly in the client code. Which is fine with me. Also the affected nodes are always reloaded after the operation, so I do not rely on the original code for moving the nodes around.
After looking into this and doing some research, "Drag & Drop multi selection" has been determined to be a new product idea. You can suggest new product ideas for future versions (or vote for existing ones) at http://ideas.infragistics.com.
There are many benefits to submitting an product idea:
- Direct communication with our product management team regarding your product idea.
- Notifications whenever new information regarding your idea becomes available.
- Ability to vote on your favorite product ideas to let us know which ones are the most important to you. You will have ten votes for this and can change which ideas you are voting for at any time.
- Allow you to shape the future of our products by requesting new controls and products altogether.
- You and other developers can discuss existing product ideas with members of our Product Management team.
Steps to create your idea:
The Product Idea site puts you in the driver’s seat and allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
Thank you for contacting Infragistics.