Edit Dialog appearing after Appointment Drag/Drop or Resize

2 posts, 0 answers
  1. Wayne
    Wayne avatar
    4 posts
    Member since:
    Apr 2011

    Posted 22 Jul 2011 Link to this post

    For various reasons I've implemented a custom control to handle the editing and creating of appointments. It works fine for everything, however there is one problem which is that when an appointment is drag and dropped, or resized, my custom control is being opened and I need to prevent this from happening (when using the standard approach the edit dialog is not opened after dragging/dropping or resizing, so I need to reproduce this behaviour).

    I am using MVVM.

    Schedule View Event Trigger:

    <i:EventTrigger
        EventName="AppointmentEditing">
        <mvvme:EventToCommand
            Command="{Binding AppointmentEditingCommand}"
            PassEventArgsToCommand="True" />
    </i:EventTrigger>


    Command within View Model

    public ICommand AppointmentEditingCommand
    {
      get
      {
        return new RelayCommand<AppointmentEditingEventArgs>((e) =>
        {
          ScheduledItemViewModel appointmentToEdit = new ScheduledItemViewModel();
          appointmentToEdit.CopyFrom(e.Appointment);
          editAppointment(appointmentToEdit);
        });
      }
    }

    editAppointment then opens a custom control with the ScheduledItemViewModel as the Data Context. This approach appears to work without issue when editing appointments normally.

    I also have an Event Handler in the code behind page that handles the ShowDialog event of the Schedule View control which I use to suppress other various dialogs. However this event does not appear to get fired when Dragging/Dropping or resizing.

    Any help would be appreciated.
  2. Yana
    Admin
    Yana avatar
    4709 posts

    Posted 28 Jul 2011 Link to this post

    Hi Wayne,

    AppointmentEditing and AppointmentEdited events fire when you edit/drag/resize appointment.

    If you want to show a custom control only when you create/double click appointment I suggest you do that in the ShowDialog event instead of AppointmentEditing.
    More details you can find here.

    All the best,
    Yana
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top