MindFusion.Scheduling for ASP.NET Programmer's Guide
Grouping

Views that can be grouped are Timetable, List and Resource. The Resource view can only operate when grouping is enabled. The other views do not support grouping.

In order to enable grouping the following steps should be done:

The following code illustrates how to enable grouping by contacts:

C#  Copy Code

// Define two contacts to group by
Contact c1 = new Contact();
c1.FirstName = "John";

Contact c2 = new Contact();
c2.FirstName = "Jack";

// Add the contacts to the schedule
calendar.Schedule.Contacts.Add(c1);
calendar.Schedule.Contacts.Add(c2);

// Select these contacts for grouping by adding them to
// the appropriate Calendar collection
calendar.Contacts.Add(c1);
calendar.Contacts.Add(c2);

// Enable grouping by contacts
calendar.GroupType = GroupType.GroupByContacts;

Visual Basic  Copy Code

' Define two contacts to group by
Dim c1 As New Contact()
c1.FirstName = "John"

Dim c2 As New Contact()
c2.FirstName = "Jack"

' Add the contacts to the schedule
calendar.Schedule.Contacts.Add(c1)
calendar.Schedule.Contacts.Add(c2)

' Select these contacts for grouping by adding them to
' the appropriate Calendar collection
calendar.Contacts.Add(c1)
calendar.Contacts.Add(c2)

' Enable grouping by contacts
calendar.GroupType = GroupType.GroupByContacts

The text displayed in the header of the corresponding resource depends on the type of the resource and is as follows:

Grouping and appearance

In Timetable view each column that represents a day is additionally subdivided to the number of grouped resources. For example if there are 3 resources selected to group by, each day column in the view is subdivided to 3 columns. The sub-columns represent individual resources and contain only the items specific for them. The sub-columns have headers containing the resource text. The header of the day column is displayed above the headers of its underlying resource columns.

In Resource view a single row is dedicated to each individual resource. The row has a header, displaying the text for that resource and contains all items, associated with that resource for the specified time interval. The row is additionally subdivided to lanes.

In List view the resources are represented by additional rows (in Horizontal layout) or columns (in Vertical layout). The row/column has a header, displaying the text for that resource and contains all items, associated with that resource for the specified time interval.

 Note

Additional examples on filtering and grouping can be found in Tutorial 2: Filtering and grouping.