deselecting appointment after drag-drop

2 posts, 0 answers
  1. Steven
    Steven avatar
    10 posts
    Member since:
    Apr 2011

    Posted 16 May 2012 Link to this post

    Hello,

    I've implemented some custom drag-drop (drag-and-swap) stuff to deal with dragging to a slot where there are more than one appointment in the slot. I'e overriden the drop function in a ScheduleViewDragDropBehavior sub-class such that not all code paths will call the base Drop function. This is all good, however, if I dont call the Drop function on the base class, the source appointment remains selected, that is, until I mouse over it. How do I deselect the source appointment (either deselect a specific appt or all appts) after what I deem to be an invalid drag-drop attempt and therefore dont call base.Drop(...) ?

    Kind regards,
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 17 May 2012 Link to this post

    Hello Steven,

    You can find the ScheduleView and set its SelectedAppointment property to null:

    var scheduleView = state.ServiceProvider.GetService<IObjectEditor<IAppointment>>() as RadScheduleView;
    scheduleView.SelectedAppointment = null;

    where state is the DragDropState.

    All the best,
    Yana
    the Telerik team

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

  3. DevCraft banner
Back to Top