Disable gantt view drag-drop feature in gantt grid

8 posts, 0 answers
  1. Prolay
    Prolay avatar
    27 posts
    Member since:
    Nov 2012

    Posted 11 Dec 2012 Link to this post

    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
  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 14 Dec 2012 Link to this post

    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.

  3. DevCraft banner
  4. Prolay
    Prolay avatar
    27 posts
    Member since:
    Nov 2012

    Posted 18 Dec 2012 Link to this post

    Hi Vladi,

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


    Regards,
    Prolay
  5. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 18 Dec 2012 Link to this post

    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.

  6. Prolay
    Prolay avatar
    27 posts
    Member since:
    Nov 2012

    Posted 16 Jan 2013 Link to this post

    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
  7. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 16 Jan 2013 Link to this post

    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.

  8. Prolay
    Prolay avatar
    27 posts
    Member since:
    Nov 2012

    Posted 16 Jan 2013 Link to this post

    Hi Miroslav ,

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



    Regards,

    Prolay
  9. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 16 Jan 2013 Link to this post

    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.

Back to Top
DevCraft banner