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

Drag&Drop Reorder: Disable "After" and "Inside"

2 Answers 127 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Ludwig
Top achievements
Rank 1
Ludwig asked on 05 Nov 2016, 06:49 PM

Hello!

At the Reorder-Drag&Drop there are 3 options to reorder the Tasks: "Before", "Inside" and "After". Is there a possibility to disable "Inside" and "After", so the user only has the option to reorder "Before"?

 

kind regards

Ludwig

2 Answers, 1 is accepted

Sort by
0
Polya
Telerik team
answered on 07 Nov 2016, 12:19 PM
Hi Ludwig,

In order to disable the drop inside and after a GanttTask we should create a custom GanttDragDropBehavior and override the GetReorderDropPosition method. This method determines the drop position depending on the overlapping value, so if we only return DropRelativePosition.Before the user would not be able to drop inside or after a GanttTask:

public class CustomDragDropBehavior : GanttDragDropBehavior
{
    protected override DropRelativePosition GetReorderDropPosition(double overlappingValue)
    {
        return DropRelativePosition.Before;
    }
}

<telerik:RadGanttView x:Name="gantt" TasksSource="{Binding GanttTasks}" VisibleRange="{Binding VisibleRange}" >
    <telerik:RadGanttView.DragDropBehavior>
        <local:CustomDragDropBehavior  />
    </telerik:RadGanttView.DragDropBehavior>
    <telerik:RadGanttView.Columns>
        <!-- ... -->
    </telerik:RadGanttView.Columns>
</telerik:RadGanttView>

Hope this helps.

Regards,
Polya
Telerik by Progress
Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
0
Ludwig
Top achievements
Rank 1
answered on 07 Nov 2016, 12:35 PM
Hello Polya and thank you very much - works like charme.
Tags
GanttView
Asked by
Ludwig
Top achievements
Rank 1
Answers by
Polya
Telerik team
Ludwig
Top achievements
Rank 1
Share this question
or