Completed
Last Updated: 19 Jun 2017 12:11 by ADMIN
ADMIN
Dimitar
Created on: 07 Mar 2017 11:32
Category: Scheduler/Reminder
Type: Bug Report
1
FIX. RadScheduler - the appointment image is over the header cells when one is scrolling.
To reproduce:
Image img1;
Image img2;
public RadForm1()
{
    InitializeComponent();
    new Telerik.WinControls.RadControlSpy.RadControlSpyForm().Show();
    img1 = Image.FromFile(@"..\..\delete.png");
    img2 = Image.FromFile(@"..\..\111.png");

    Color[] colors = new Color[]{Color.LightBlue, Color.LightGreen, Color.LightYellow,
.Red, Color.Orange, Color.Pink, Color.Purple, Color.Peru, Color.PowderBlue};
    string[] names = new string[]{"Alan Smith", "Anne Dodsworth",
n Mastoni", "Richard Duncan", "Maria Shnaider"};
    for (int i = 0; i < names.Length; i++)
    {
        Resource resource = new Resource();
        resource.Id = new EventId(i);
        resource.Name = names[i];
        resource.Color = colors[i];
        resource.Image = img2;
        this.radScheduler1.Resources.Add(resource);
    }

    this.radScheduler1.ActiveView.ResourcesPerView = 2;
    this.radScheduler1.GroupType = GroupType.Resource;

    SchedulerDayViewGroupedByResourceElement dayView = this.radScheduler1.SchedulerElement.ViewElement as SchedulerDayViewGroupedByResourceElement;
    
    dayView.ResourceHeaderHeight = 120;

    radScheduler1.AppointmentFormatting += RadScheduler1_AppointmentFormatting;

    radScheduler1.Appointments.Add(new Appointment(DateTime.Now.AddHours(-7), DateTime.Now.AddHours(-5), "Summary", "Description") { ResourceId = radScheduler1.Resources[0].Id });
   
}

private void RadScheduler1_AppointmentFormatting(object sender, SchedulerAppointmentEventArgs e)
{
    e.AppointmentElement.Image = img1

}

- Drag the appointment to the top if needed.
- Scroll down.

Workaround:

private void RadScheduler1_AppointmentFormatting(object sender, SchedulerAppointmentEventArgs e)
{
    if (e.AppointmentElement.Children.Count ==0)
    {
        LightVisualElement el = new LightVisualElement();
        el.DrawImage = true;
        el.Image = img1;
        e.AppointmentElement.Children.Add(el);
    }
}


1 comment
ADMIN
Peter
Posted on: 07 Mar 2017 16:10
Workaround #2 - use BackgroundImage 
private void RadScheduler1_AppointmentFormatting(object sender, SchedulerAppointmentEventArgs e)
{
    e.AppointmentElement.BackgroundImage = img1;
}