Hi,
Here is the sample code (along with some comments), which will help you achieve your goals:
// Switch to timetable
calendar1.CurrentView = CalendarView.Timetable;
// Add resources
for (int i = 0; i < 20; i++)
{
Resource resource = new Resource();
resource.Name = string.Format("Resource #{0}", i);
calendar1.Schedule.Resources.Add(resource);
calendar1.Resources.Add(resource);
// Note: The resources are added to both Schedule.Resources and
// Calendar.Resources collections. The first collection should
// contain all resources in the schedule. The second collection
// contains a subset of all resources, which are selected to group by.
// In the above case all resources are selected for grouping
}
// Enable grouping by the resources added above
calendar1.GroupType = GroupType.GroupByResources;
// Specify the number of columns to be visible at the same time
calendar1.TimetableSettings.VisibleColumns = 5; // (or all 20?)
// Set 10-minute time increments
calendar1.TimetableSettings.CellTime = TimeSpan.FromMinutes(10);
// Change the theme?
calendar1.Theme = ThemeType.Vista;
Quote:I will also want to show a time table view for a single resource across multiple days.
To modify the resources you group by, simply modify the contents of the Calendar.Resources collection. The following code groups only by the 6th resource
calendar1.Resources.Clear();
calendar1.Resources.Add(calendar1.Schedule.Resources[5]);
To add more dates to display in the Timetable, do the following:
calendar1.TimetableSettings.Dates.Add(DateTime.Today.AddDays(1));
calendar1.TimetableSettings.Dates.Add(DateTime.Today.AddDays(2));
Let me know if this helps.
Regards,
Meppy