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

Edit Dialog appearing after Appointment Drag/Drop or Resize

1 Answer 83 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Wayne
Top achievements
Rank 1
Wayne asked on 22 Jul 2011, 10:24 AM
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.

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 28 Jul 2011, 09:21 AM
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!

Tags
ScheduleView
Asked by
Wayne
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or