Is it possible to replace appointment dialog with a message box??

6 posts, 1 answers
  1. Anoop
    Anoop avatar
    76 posts
    Member since:
    Sep 2006

    Posted 19 Apr 2011 Link to this post

     Is it possible to add for example a message box or another window when we click on the appointment box?

    I mean instead of the appointment dialog I want to view another window or message box.

     

    PS: I do not mean custom appointment dialog

     

    Thanks in advance

  2. Answer
    Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 22 Apr 2011 Link to this post

    Hi Anoop,

    Thank you for your question.

    Yes, this is possible. In order to achieve this, you should subscribe to the scheduler's AppointmentEditDialogShowing event, cancel the original dialog's opening and show your message box. The following code snippet demonstrates this:
    void radScheduler1_AppointmentEditDialogShowing(object sender, AppointmentEditDialogShowingEventArgs e)
    {
        List<SchedulerCellElement> cells = SchedulerUIHelper.GetSelectedCells(this.radScheduler1);
        if (cells.Count == 0)
            return;
        DialogResult result = MessageBox.Show("Are you sure want to add an appointment?", "Question", MessageBoxButtons.YesNo);
        if (result == System.Windows.Forms.DialogResult.Yes)
        {
            Appointment appointment = new Appointment(cells[0].Date, cells[cells.Count - 1].Date.AddHours(1), "New Appointment");
            this.radScheduler1.Appointments.Add(appointment);
        }
     
        e.Cancel = true;
    }

    I hope this helps. If you have any additional questions, do not hesitate to contact me.

    Greetings,
    Ivan Todorov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Anoop
    Anoop avatar
    76 posts
    Member since:
    Sep 2006

    Posted 27 Apr 2011 Link to this post

    Instead of the message box when I need to add my own form, how can I add it in message box way
  5. Anoop
    Anoop avatar
    76 posts
    Member since:
    Sep 2006

    Posted 01 May 2011 Link to this post

    I wanna add my own form or dialog to view the data of each appointment differently according to its category.

     

    For example see the attached picture just sample.

  6. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 02 May 2011 Link to this post

    Hi Anoop,

    You can get information about the selected appointment from the event args:
    void radScheduler1_AppointmentEditDialogShowing(object sender, AppointmentEditDialogShowingEventArgs e)
    {
        if (e.Appointment != null && this.radScheduler1.Appointments.Contains(e.Appointment))
        {
            MessageBox.Show("Editing appointment: " + e.Appointment.Summary + " " + e.Appointment.Start + " - " + e.Appointment.End);
            e.Cancel = true;
        }
    }

    If there is a selected appointment, e.Appointment it. Otherwise, it contains a temporary appointment that is created according to the selected cells. To understand whether we are creating a new appointment or editing an existing one, we can check if the Appointments collection of our scheduler contains e.Appointment.

    I hope this helps. Feel free to ask if you have any additional questions.

    Greetings,
    Ivan Todorov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Anoop
    Anoop avatar
    76 posts
    Member since:
    Sep 2006

    Posted 11 May 2011 Link to this post

    Thank you Ivan Todorov

    Regards,
Back to Top
UI for WinForms is Visual Studio 2017 Ready