To reproduce:
public Form1()
{
InitializeComponent();
this.radScheduler1.ActiveViewType = SchedulerViewType.Timeline;
Timescales scale = Timescales.Hours;
this.radScheduler1.GetTimelineView().ShowTimescale(scale);
Appointment app1 = new Appointment(DateTime.Today.AddHours(6), TimeSpan.FromMinutes(25), "A1");
Appointment app2 = new Appointment(DateTime.Today.AddHours(6).AddMinutes(25), TimeSpan.FromMinutes(16), "A2");
Appointment app3 = new Appointment(DateTime.Today.AddHours(6).AddMinutes(41), TimeSpan.FromMinutes(12), "A3");
this.radScheduler1.Appointments.Add(app1);
this.radScheduler1.Appointments.Add(app2);
this.radScheduler1.Appointments.Add(app3);
this.radScheduler1.EnableExactTimeRendering = true;
}
Workaround:
this.radScheduler1.ElementProvider = new MyElementProvider(this.radScheduler1);
public class MyElementProvider : SchedulerElementProvider
{
public MyElementProvider(RadScheduler scheduler) : base(scheduler)
{
}
protected override T CreateElement<T>(SchedulerView view, object context)
{
if (typeof(T) == typeof(TimelineAppointmentsPresenter))
{
return new CustomTimelineAppointmentsPresenter(this.Scheduler, view, (SchedulerTimelineViewElement)context)as T;
}
return base.CreateElement<T>(view, context);
}
}
public class CustomTimelineAppointmentsPresenter: TimelineAppointmentsPresenter
{
public CustomTimelineAppointmentsPresenter(RadScheduler scheduler, SchedulerView view,
SchedulerTimelineViewElement timelineViewElement) : base(scheduler, view, timelineViewElement)
{
}
protected override void ResolveOverlappingAppointments(SizeF availableSize)
{
List<AppointmentElement> appointments = new List<AppointmentElement>();
foreach (AppointmentElement element in this.AppointmentElements)
{
if (element.Visibility != ElementVisibility.Collapsed)
{
appointments.Add(element);
}
}
appointments.Sort(new DateTimeComparer(this.Scheduler));
List<AppointmentElement> arrangedAppointments = new List<AppointmentElement>();
foreach (AppointmentElement appointment in appointments)
{
for (int i = 0; i < arrangedAppointments.Count; i++)
{
AppointmentElement otherAppointment = arrangedAppointments[i];
if (otherAppointment == appointment)
{
continue;
}
RectangleF rect = appointment.DesiredBounds;
rect.Inflate(new SizeF(-2,-2));
if (otherAppointment.DesiredBounds.IntersectsWith(rect))
{
appointment.DesiredBounds.Y = otherAppointment.DesiredBounds.Bottom;
i = -1;
continue;
}
}
arrangedAppointments.Add(appointment);
}
}
}