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

Is it possible to disable drag and drop

9 Answers 316 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Martha
Top achievements
Rank 1
Martha asked on 24 Aug 2011, 04:39 PM
I want to prevent the user from using drag & drop to edit an appointment. Is this possible?

9 Answers, 1 is accepted

Sort by
0
Martha
Top achievements
Rank 1
answered on 24 Aug 2011, 05:25 PM
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)
0
Valeri Hristov
Telerik team
answered on 25 Aug 2011, 07:37 AM
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 >>

0
Martha
Top achievements
Rank 1
answered on 26 Aug 2011, 06:45 PM

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>

0
Valeri Hristov
Telerik team
answered on 29 Aug 2011, 09:30 AM
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 >>

0
Rosco
Top achievements
Rank 1
answered on 12 Oct 2011, 04:47 AM
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?
0
Rosi
Telerik team
answered on 12 Oct 2011, 07:28 AM
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 >>

0
Rosco
Top achievements
Rank 1
answered on 12 Oct 2011, 08:06 AM
I don't have this available either. See the attachment of what is available in the object browser for Telerik.Windows.Controls.ScheduleView.
0
Rosi
Telerik team
answered on 12 Oct 2011, 08:19 AM
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 >>

0
Rosco
Top achievements
Rank 1
answered on 27 Oct 2011, 04:00 AM
Thanks, that worked.
Tags
ScheduleView
Asked by
Martha
Top achievements
Rank 1
Answers by
Martha
Top achievements
Rank 1
Valeri Hristov
Telerik team
Rosco
Top achievements
Rank 1
Rosi
Telerik team
Share this question
or