Disable drag and drop

4 posts, 0 answers
  1. Tim
    Tim avatar
    41 posts
    Member since:
    Oct 2012

    Posted 09 Apr 2013 Link to this post

    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

  2. Georgi
    Admin
    Georgi avatar
    350 posts

    Posted 12 Apr 2013 Link to this post

    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.

  3. DevCraft banner
  4. Tim
    Tim avatar
    41 posts
    Member since:
    Oct 2012

    Posted 12 Apr 2013 Link to this post

    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
  5. Georgi
    Admin
    Georgi avatar
    350 posts

    Posted 16 Apr 2013 Link to this post

    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.

Back to Top