Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2094
Using Message/InputBox in AppointmentMoved Event Causes the Move to be cancelled
posted

Hi,

I am having a weird problem when I am trying to use a messagebox or inputbox in my DayView AppointmentMoved Event. If I do as follows the moved actually gets cancelled and moves back to its original position.

HOW IS THIS SO??? I can't see why this is happening.

Private Sub UltraDayView1_AfterAppointmentsMoved(ByVal sender As Object, ByVal e Infragistics.Win.UltraWinSchedule.AfterAppointmentsMovedEventArgs) Handles UltraDayView1.AfterAppointmentsMoved

    MessageBox.Show("test messagebox", "Test", MessageBoxButtons.OK, MessageBoxIcon.Information)

End Sub


Secondly: Is it possible to only capture the FINAL MOVING POSITION of the appointment? By this I mean, when a user drags an appointment to a new location (whether it be on a different date, different time, different owner)... as the user drags it around the screen each time the appointment "slots" into a new timeslot it seems to fire the AppointmentMoved event.

Is it possible to fire the AppointmentMoved Event ONLY ONCE THE USER has released thier mouse button (Hence the appointment is in it's final resting place) in effect stopping the firing of the appointmentmoved event whilst the user is dragging the appointment across the screen to the new location?

My end goal is to VALIDATE the appointment once it is in its original position. I am storing a copy of the "Original" appointments in a business class - these are captured at the "BeforeAppointmentMoved" event.  Once it is moved then validate. If it does not validate then change the appointment back to the original values.

BeforeAppointmentMoved
Store All 'about to be moved appointments' into a class

AfterAppointmentMoved
Validate Appointment

If Validate = OK then
     Do Nothing
Else
     Prompt user for password to override validation
        If Password = OK then
            Do Nothing
        Else
            Change appointment Values back to original values
        End if
End If


Thanks In Advance.

Parents
  • 69832
    Verified Answer
    Offline posted

    Showing a MessageBox (which is modal) in response to the AfterAppointmentMoved event causes the capture to be ripped away from the control, making it impossible to continue a drag operation. When a drag operation is terminated abnormally, the appointment's StartDateTime and EndDateTime properties revert to their original values.

    The AppointmentsDragComplete event fires when a drag operation has been completed.

Reply Children
No Data