This is a migrated thread and some comments may be shown as answers.

Drag&Drop Reorder: how to avoid that a child task is dropped on a different parent node

1 Answer 28 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Giorgio
Top achievements
Rank 1
Giorgio asked on 24 Mar 2017, 04:42 PM

Hello,

Is there a way to avoid that during the ordering a task child of a summary node is dragged under another summary node?

I think that I have to do this overriding the GanttDragDropBehavior.CanDrop() function but I can't find how to know when the DestinationSlot changes his parent node

Any help will be appreciated
Thanks in advance

 

1 Answer, 1 is accepted

Sort by
0
Polya
Telerik team
answered on 29 Mar 2017, 08:24 AM
Hi Giorgio,

You are correct in creating a custom GanttDragDropBehavior and overriding the CanDrop method. As the desired functionality does not come out of the box, I suggest creating a custom GanttTask in which you can include a property SummaryParent (of type CustomGanttTask) and set it for each non-summary task when populating the TasksSource.

This way in the overridden CanDrop method you can check whether the SchedulingDragDropState.DestinationSlot.Start.Date and End.Date are in the range of the (SchedulingDragDropState.DraggedItem as CustomGanttTask).SummaryParent.Start and End.

You can check our Drag and Resize Configurator example from our QSF examples for reference - http://demos.telerik.com/wpf/.

Hope this helps.

Regards,
Polya
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GanttView
Asked by
Giorgio
Top achievements
Rank 1
Answers by
Polya
Telerik team
Share this question
or