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

Disable drag and drop

3 Answers 88 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 09 Apr 2013, 09:54 PM
I have a drop down that a user selects. Depending on the value of the drop down and the users permissions for that value, I need to disable drag and drop of appointments.

I already have the logic down for determining if the user can drag and drop but am not sure how I can conditionally set this value.

I have been able to disable editing from this but would also like to disable the drag and drop and also the resizing of appointments.

Thanks

3 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 12 Apr 2013, 12:51 PM
Hello Tim,

I have attached a simple project showing how you can disable the Drag And Drop of appointments. Basically I have created a DisableDragingBehavior witch disables the dragging and I have set it as an item of an ComboBox (could be DropDown) as I have added also the normal behavior.
So the DragDropBehavior property of the ScheduleView is bound to the SelectedItem of the ComboBox and when switching the items changes the behavior. I am not sure about your scenario but if you have different permissions and they are chosen from the Drop Down you can create suitable class containing the type of the permission and the behaviors connected to them so the permissions can be bound to the Drop down.
If you have any other questions, please don't hesitate to contact us.

Kind regards,
Georgi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Tim
Top achievements
Rank 1
answered on 12 Apr 2013, 01:35 PM
Georgi,

How would I do this from the ViewModel itself?

Here's my scenario: The user chooses a value from the dropdown. I then go out and get more data based on that option. From this data I need to set the DragDrop behavior from the ViewModel. So it's not entirely dependant on just the drop down.

Tim
0
Georgi
Telerik team
answered on 16 Apr 2013, 10:50 AM
Hi Tim,

What you can try is to create a new property of type ScheduleViewDragDropBehavior in the ViewModel and bind it to the ScheduleView. So when you execute your logic and determine what the permissions should be you can set the corresponding behavior to the new created property. I am attaching a simple project demonstrating the described suggestion.
Hope this would help.

Greetings,
Georgi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ScheduleView
Asked by
Tim
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Tim
Top achievements
Rank 1
Share this question
or