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

Disable gantt view drag-drop feature in gantt grid

7 Answers 274 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Prolay
Top achievements
Rank 1
Prolay asked on 11 Dec 2012, 10:53 AM
Hi

I have updated the latest set of dlls. There is a new addition drag drop feature in this release wherein one can reorder the tasks. For one gantt chart i need to disable this so i have made this following class and changed the DragDropBehavior of the Gantt View

public class CustomDragDropBehavior : SchedulingDragDropBehavior
{
    protected override bool CanStartDrag(SchedulingDragDropState state)
    {
        return false;
    }
 
    protected override bool CanDrop(SchedulingDragDropState state)
    {
        return false;
    }
}


public MainPage()
{
       InitializeComponent();
 
       ganttview.DragDropBehavior = new CustomDragDropBehavior();
 
}

I am getting an error when i start to drag drop. I have attached the screenshot

I have referenced the following dlls

Telerik.Windows.Controls.dll
Telerik.Windows.Controls.Docking.dll
Telerik.Windows.Controls.GanttView.dll
Telerik.Windows.Controls.Input.dll
Telerik.Windows.Controls.Navigation.dll
Telerik.Windows.Controls.RibbonView.dll
Telerik.Windows.Scheduling.Core.dll
Telerik.Windows.Themes.Metro.dll
Telerik.Windows.Themes.Windows8.dll


This is the stack trace of the error

at Telerik.Windows.Controls.GanttView.Internal.GridReorderInteractionObserver.InitializeDrag(IDateRange dataItem, TimeSpan dragPointOffset, Object groupKey)
at Telerik.Windows.Controls.Scheduling.Internal.DragAndDropInteractionObserver.InitializeDragOperation(DragOperationType operationType, DragDropElementType sourceType, Object dataItem, TimeSpan dragPointOffset, Int32 startGroupIndex)
at Telerik.Windows.Controls.Scheduling.Internal.GridDragAndDropInteractionHelper.OnDragInitialize(Object sender, DragInitializeEventArgs e)
at Telerik.Windows.DragDrop.DragInitializeEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at Telerik.Windows.RadRoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at Telerik.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RadRoutedEventArgs routedEventArgs)
at Telerik.Windows.RouteItem.InvokeHandler(RadRoutedEventArgs routedEventArgs)
at Telerik.Windows.EventRoute.InvokeHandlersImpl(Object source, RadRoutedEventArgs args, Boolean raisedAgain)
at Telerik.Windows.EventRoute.InvokeHandlers(Object source, RadRoutedEventArgs args)
at Telerik.Windows.RadRoutedEventHelper.RaiseEvent(DependencyObject element, RadRoutedEventArgs args)
at Telerik.Windows.DependencyObjectExtensions.RaiseEvent(DependencyObject element, RadRoutedEventArgs e)
at Telerik.Windows.DragDrop.DragInitializer.StartDrag()
at Telerik.Windows.DragDrop.DragInitializer.StartDragPrivate(UIElement sender)
at Telerik.Windows.DragDrop.DragInitializer.DragSourceOnMouseMove(Object sender, MouseEventArgs e)
at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)


Thanks and Regards,
Prolay

7 Answers, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 14 Dec 2012, 03:40 PM
Hello Prolay,

There was an issue concerning customizing the DragDropBehavior in the controls version you are using. The good news is that the issue is fixed in our latest internal build (2012 3 1210).

Could you try to reproduce it with the latest internal build dlls and let us know if the issue persists?

Regards,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Prolay
Top achievements
Rank 1
answered on 18 Dec 2012, 09:14 AM
Hi Vladi,

This is the latest version that i can get from the control panel 2012.3.1129.
What should i do?


Regards,
Prolay
0
Vladi
Telerik team
answered on 18 Dec 2012, 03:13 PM
Hi Prolay,

You can access the latest internal builds in the Manage Products>Trial Downloads menu and then click the Download button.

I will also give you a direct link that you can access them from.

Kind regards,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Prolay
Top achievements
Rank 1
answered on 16 Jan 2013, 09:52 AM
Hi Vladi,

Now this has stopped working with the latest release.
protected override bool CanStartDrag(SchedulingDragDropState state)
{
    return true;
}
 
protected override bool CanDrop(SchedulingDragDropState state)
{
    return true;
}

Regards,

Prolay
0
Miroslav Nedyalkov
Telerik team
answered on 16 Jan 2013, 10:41 AM
Hello Prolay,

I tried this with the latest internal build and it works just fine. Please refer to the attached project and let me know if I'm missing something. 

Regards,
Miroslav Nedyalkov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Prolay
Top achievements
Rank 1
answered on 16 Jan 2013, 12:08 PM
Hi Miroslav ,

I got the following error running your project. 
Attached Screenshots.



Regards,

Prolay
0
Miroslav Nedyalkov
Telerik team
answered on 16 Jan 2013, 05:29 PM
Hello Prolay,

Thank you for reporting us this problem and for providing us with images - this helped a lot. We will address the issue for the next internal build.

Kind regards,
Miroslav Nedyalkov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GanttView
Asked by
Prolay
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Prolay
Top achievements
Rank 1
Miroslav Nedyalkov
Telerik team
Share this question
or