Is it possible to disable drag and drop

10 posts, 0 answers
  1. Martha
    Martha avatar
    26 posts
    Member since:
    Aug 2011

    Posted 24 Aug 2011 Link to this post

    I want to prevent the user from using drag & drop to edit an appointment. Is this possible?
  2. Martha
    Martha avatar
    26 posts
    Member since:
    Aug 2011

    Posted 24 Aug 2011 Link to this post

    OK I was able to do this using:

     

    RadDragAndDropManager.SetAllowDrag(Schedule, false);

     

    RadDragAndDropManager.SetAllowDrop(Schedule, false);


    But it still looks like you can drag the appt. It creates a hovering image of the appt like it will allow you to drag & drop it (see image attached)
  3. DevCraft banner
  4. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 25 Aug 2011 Link to this post

    Hello Martha,

    You need to create a custom drag-drop behavior and override the CanStartDrag() method, where you should return false:

    http://www.telerik.com/help/silverlight/radscheduleview-features-draganddrop.html

    Kind regards,
    Valeri Hristov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  5. Martha
    Martha avatar
    26 posts
    Member since:
    Aug 2011

    Posted 26 Aug 2011 Link to this post

    Thanks that worked.
    But the base class in documentation is incorrect. There is no ScheduleViewDragDropBehavior class. I had to use DefaultDragDropBehavior.

    Here is my code in case anyone is trying to do the same thing:

    public class ScheduleDragDropBehavior : DefaultDragDropBehavior
    {
        public override bool CanStartDrag(DragDropState state)
        {
            return false;
        }
     
        public override bool CanDrop(DragDropState state)
        {
            return false;
        }
     
        public override bool CanStartResize(DragDropState state)
        {
            return false;
        }
     
        public override bool CanResize(DragDropState state)
        {
            return false;
        }
    }

    And the XAML is:

    <telerik:RadScheduleView.DragDropBehavior>
        <local:ScheduleDragDropBehavior />
    </telerik:RadScheduleView.DragDropBehavior>

  6. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 29 Aug 2011 Link to this post

    Hello Martha,

    We recently renamed the class, it seems that the documentation was not updated correctly. Thank you for the heads up, we will fix the article as soon as possible.

    Regards,
    Valeri Hristov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  7. Rosco
    Rosco avatar
    32 posts
    Member since:
    Oct 2008

    Posted 11 Oct 2011 Link to this post

    Hi,

    I am trying to do the same thing here. I have created a new class in my Silverlight project (as Martha has done) however the DefaultDragDropBehavior class is not available. I have added a reference to Telerik.Windows.Controls.ScheduleView. Am I missing a step here?
  8. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 12 Oct 2011 Link to this post

    Hi ,

    The DefaultDragDropBehavior class is renamed to ScheduleViewDragDropBehavior.

    Hope this helps.

    Regards,
    Rosi
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  9. Rosco
    Rosco avatar
    32 posts
    Member since:
    Oct 2008

    Posted 12 Oct 2011 Link to this post

    I don't have this available either. See the attachment of what is available in the object browser for Telerik.Windows.Controls.ScheduleView.
  10. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 12 Oct 2011 Link to this post

    Hi Rosco,

    I suggest you upgrade to the latest Q2 2011 SP1 version of the control. This should solve the issue.

    Regards,
    Rosi
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  11. Rosco
    Rosco avatar
    32 posts
    Member since:
    Oct 2008

    Posted 26 Oct 2011 Link to this post

    Thanks, that worked.
Back to Top
DevCraft banner