Declined
Last Updated: 12 Feb 2016 08:38 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 20 Jan 2016 07:52
Category: Scheduler/Reminder
Type: Bug Report
0
FIX. RadScheduler - one day is missing at the end of appointment when using BindingList
To reproduce: use the following code snippet:

private BindingList<MyEvent> eventsSource = new BindingList<MyEvent>();
private AppointmentMappingInfo appointmentMappingInfo_g = new AppointmentMappingInfo();

public RadForm2()
{
    InitializeComponent();
}

private void RadForm2_Load(object sender, EventArgs e)
{
    radScheduler1.ActiveViewType = radScheduler2.ActiveViewType = SchedulerViewType.Timeline;
    radScheduler1.GetTimelineView().ShowTimescale(Timescales.Days);
    radScheduler2.GetTimelineView().ShowTimescale(Timescales.Days);
    radScheduler1.GetTimelineView().RangeStartDate = radScheduler2.GetTimelineView().RangeStartDate = new DateTime(2015, 9, 1);
    radScheduler1.GetTimelineView().RangeEndDate = radScheduler2.GetTimelineView().RangeEndDate = new DateTime(2015, 9, 30);
    radScheduler1.GetTimelineView().StartDate = radScheduler2.GetTimelineView().StartDate = new DateTime(2015, 9, 1);
    radScheduler1.GetTimelineView().GetScaling().DisplayedCellsCount = radScheduler2.GetTimelineView().GetScaling().DisplayedCellsCount = 7;

    appointmentMappingInfo_g.Start = "Start";
    appointmentMappingInfo_g.End = "End";
    appointmentMappingInfo_g.Summary = "Subject";
    appointmentMappingInfo_g.Description = "Description";
    appointmentMappingInfo_g.Location = "Location";
    appointmentMappingInfo_g.UniqueId = "Id";

    SchedulerBindingDataSource dataSource_l = new SchedulerBindingDataSource();
    dataSource_l.EventProvider.Mapping = appointmentMappingInfo_g;
    dataSource_l.EventProvider.DataSource = eventsSource;
    radScheduler2.DataSource = dataSource_l;

    FillAppointments();
}

private void FillAppointments()
{
    Appointment appointment = new Appointment(new DateTime(2015, 9, 2), new DateTime(2015, 9, 6), "DU 2 AU 6");
    appointment.AllDay = true;

    radScheduler1.Appointments.BeginUpdate();
    radScheduler1.Appointments.Add(appointment);
    radScheduler1.Appointments.EndUpdate();

    MyEvent appointment2 = new MyEvent(new DateTime(2015, 9, 2), new DateTime(2015, 9, 6), "DU 2 AU 6","","","");
    radScheduler2.Appointments.BeginUpdate();
    eventsSource.Add(appointment2);
    radScheduler2.Appointments.EndUpdate();
}

public class MyEvent
{
    public DateTime Start { get; set; }

    public DateTime End { get; set; }

    public string Subject { get; set; }

    public string Description { get; set; }

    public string Location { get; set; }

    public string UniqueId { get; set; }

    public MyEvent(DateTime start, DateTime end, string subject,
        string description, string location, string uniqueId)
    {
        this.Start = start;
        this.End = end;
        this.Subject = subject;
        this.Description = description;
        this.Location = location;
        this.UniqueId = uniqueId;
    }
}

Workaround: specify the end day with 1 second more:
 MyEvent appointment2 = new MyEvent(new DateTime(2015, 9, 2), new DateTime(2015, 9, 6, 0, 0, 1), "DU 2 AU 6", "", "", "");
Attached Files:
1 comment
ADMIN
Stefan
Posted on: 12 Feb 2016 08:38
This item is being declined as the issue is not with RadScheduler. The missing day is caused by a missing mapping of the AllDay field. The appointment that is added to RadScheduler has its AllDay property set to true, while the appointment that is added via the DataSource does not have this property set, due to a missing mapping. Adding the following mapping will render the appointment properly: appointmentMappingInfo_g.AllDay= "AllDay";