How not to show the EditAppointmentDialog ?

4 posts, 1 answers
  1. Sarah
    Sarah avatar
    4 posts
    Member since:
    Mar 2012

    Posted 01 Mar 2012 Link to this post

    Hi!

    Everything's in the title,  I want to totally disable the AppointmentEditDialogShowingEvent. Is that posible ?

    Also, how can we retrieve the Start and End Time when clicking on an appointment ?

    Thanks...
  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 05 Mar 2012 Link to this post

    Hi Sarah,

    You could do the following:

    1: Remove the Edit Appointment item from the context menu:
    private void radScheduler1_ContextMenuShowing(object sender, SchedulerContextMenuShowingEventArgs e)
    {
        if (e.Element is AppointmentElement)
        {
            e.ContextMenu.Items.RemoveAt(0);
        }
    }


    2: When the user double clicks an appointment to edit it, cancel this and grab the start and finish time instead.

    private void radScheduler1_AppointmentEditDialogShowing(object sender, AppointmentEditDialogShowingEventArgs e)
    {
        MessageBox.Show("Starts at: " + e.Appointment.Start.ToString() + " Ends At: " + e.Appointment.End.ToString());
        e.Cancel = true;
    }

    Hope that helps.
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Sarah
    Sarah avatar
    4 posts
    Member since:
    Mar 2012

    Posted 06 Mar 2012 Link to this post

    Hi Richard, 

    Thanks for the reply, it works perfectly! 

    Sarah
  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 06 Mar 2012 Link to this post

    Glad that helped! Please remember to mark as answer so others can find the solution too.
    Regards,
    Richard
Back to Top