Hello Karl,
Thank you for contacting us.
The issue is that you are setting the
GroupType property when resources have not yet been added to
RadScheduler. If you set this property after filling the Resources collection, the code you have provided works fine. Also, the
ResourcesPerView property indicates how many resources should be visible at a time in the current view, so you should not set this with a value larger than the resources quantity:
Schedule.ActiveViewType = Telerik.WinControls.UI.SchedulerViewType.Timeline;
SchedulerDayViewGroupedByResourceElement headerElement = Schedule.SchedulerElement.ViewElement as SchedulerDayViewGroupedByResourceElement;
Resource resource;
resource = new Resource();
resource.Id = new EventId("AC00-1");
resource.Name = "AC00-1";
resource.Color = Color.Beige;
Schedule.Resources.Add(resource);
resource = new Resource();
resource.Id = new EventId("AC00-2");
resource.Name = "AC00-2";
resource.Color = Color.PowderBlue;
Schedule.Resources.Add(resource);
resource = new Resource();
resource.Id = new EventId("AC00-3");
resource.Name = "AC00-3";
resource.Color = Color.PowderBlue;
Schedule.Resources.Add(resource);
Schedule.Appointments.BeginUpdate();
Appointment appointment;
appointment = new Appointment(new DateTime(2011, 12, 07, 12, 00, 00), new DateTime(2011, 12, 09, 12, 00, 00), "Summary", "Descriptions", "Location");
appointment.ResourceId = this.Schedule.Resources[0].Id;
appointment.BackgroundId = (int)AppointmentBackground.Important;
appointment.ToolTipText = "This is my custom Tooltip";
Schedule.Appointments.Add(appointment);
Schedule.GroupType = GroupType.Resource;
Schedule.GetTimelineView().ResourcesPerView = 3;
I hope this is helpful. Should you need further help, do not hesitate to contact us.
All the best,
Ivan Todorov
the Telerik team