This question is locked. New answers and comments are not allowed.
I have challenge with TreeView and drag and drop feature.
My goal is to implement next behavior:
1. User drop one item onto another
2. System show pop-up like "Enter node title"
3. Create sub-node to drop target with entered title
4. Append dropped element to created sub-node,
What I'm trying to do
Probably it doesn't have any sense. I hope you can provide me with some directions or partial solution.
Best Regards, Roman
My goal is to implement next behavior:
1. User drop one item onto another
2. System show pop-up like "Enter node title"
3. Create sub-node to drop target with entered title
4. Append dropped element to created sub-node,
What I'm trying to do
| //HierarchyTree.ItemSource = collection of ItemContainer; |
| HierarchyTree.DragEnded += HierarchyTree_DragEnded; |
| void HierarchyTree_DragEnded(object sender, RadTreeViewDragEndedEventArgs e) { |
| if (e.IsCanceled == true) { |
| return; |
| } |
| RadTreeViewItem item = e.TargetDropItem; |
| ItemContainer container = item.Item as ItemContainer; |
| if (container != null) { |
| if (e.DropPosition == DropPosition.Inside) { |
| Question question = new Question("Condition"); |
| ItemContainer newContainer = new ItemContainer(question); |
| newContainer.IsCondition = true; |
| newContainer.Children.Add(container); |
| e.DraggedItems.Clear(); |
| e.DraggedItems.Add(newContainer); |
| } |
| } |
| } |
Probably it doesn't have any sense. I hope you can provide me with some directions or partial solution.
Best Regards, Roman
