Completed
Last Updated: 19 Jun 2017 12:12 by ADMIN
ADMIN
Hristo
Created on: 09 Mar 2017 09:48
Category: Scheduler/Reminder
Type: Bug Report
1
FIX. RadScheduler - the copying and pasting an appointment is not raising the AppointmentAdded event
How to reproduce:
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        this.radScheduler1.AppointmentAdded += radScheduler1_AppointmentAdded;

        Appointment appointment = new Appointment(DateTime.Now, TimeSpan.FromMinutes(60), "Summary", "Description");
        appointment.StatusId = 2;
        appointment.BackgroundId = 6;
        this.radScheduler1.Appointments.Add(appointment);
    }

    private void radScheduler1_AppointmentAdded(object sender, AppointmentAddedEventArgs e)
    {
        Console.WriteLine("AppointmentAdded");
    }
}

Workaround:
public Form1()
        {
            InitializeComponent();

            this.radScheduler1.Appointments.CollectionChanged += Appointments_CollectionChanged;

            Appointment appointment = new Appointment(DateTime.Now, TimeSpan.FromMinutes(60), "Summary", "Description");
            appointment.StatusId = 2;
            appointment.BackgroundId = 6;
            this.radScheduler1.Appointments.Add(appointment);
        }

        private void Appointments_CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
        {
            if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Add)
            {
                Console.WriteLine("AppointmentAdded");    
            }
        }
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments