Class Group

Group class

Represents a group definition. A Group object is a member of the ResourceGroups collection or the TaskGroups collection.

public class Group

Constructors

NameDescription
Group()Initializes a new instance of the Group class.

Properties

NameDescription
GroupAssignments { get; set; }Gets or sets a value indicating whether assignments should be grouped instead of tasks.
GroupCriteria { get; set; }Gets or sets a GroupCriteria collection representing the fields in a group definition.
Index { get; }Gets the index of a Group object in the Groups containing object.
MaintainHierarchy { get; set; }Gets or sets a value indicating whether to show all the levels of summary tasks for subtasks within group.
Name { get; set; }Gets or sets a name of a Group object.
ShowInMenu { get; set; }Gets or sets a value indicating whether Project shows the group name in the Group drop-down list in the Ribbon.
ShowSummary { get; set; }Gets or sets a value indicating whether summary rows are displayed for the group.
Uid { get; }Gets a unique identifier of a group.

Examples

Shows how to work with groups.

var project = new Project(DataDir + "ReadGroupDefinitionData.mpp");

Console.WriteLine("Task Groups Count: " + project.TaskGroups.Count);
var group = project.TaskGroups.ToList()[1];
Console.WriteLine("Task Group Uid: " + group.Uid);
Console.WriteLine("Task Group Index: " + group.Index);
Console.WriteLine("Task Group Name: " + group.Name);
Console.WriteLine("Is Task Group Maintain Hierarchy?: " + group.MaintainHierarchy);
Console.WriteLine("Is Task Group Show In Menu?: " + group.ShowInMenu);
Console.WriteLine("Is Task Group Show Summary?: " + group.ShowSummary);
Console.WriteLine("Task Group Criteria count: " + group.GroupCriteria.Count);
Console.WriteLine("\n************* Retrieving Task Group's Criterion information *************");

foreach (var criterion in group.GroupCriteria)
{
    Console.WriteLine("Task Criterion Field: " + criterion.Field);
    Console.WriteLine("Task Criterion GroupOn: " + criterion.GroupOn);
    Console.WriteLine("Task Criterion Cell Color: " + criterion.CellColor);
    Console.WriteLine("Task Criterion Pattern: " + criterion.Pattern);

    if (group == criterion.ParentGroup)
    {
        Console.WriteLine("Parent Group is equal to task Group.");
    }

    Console.WriteLine("Font Name: " + criterion.Font.FontFamily);
    Console.WriteLine("Font Size: " + criterion.Font.Size);
    Console.WriteLine("Font Style: " + criterion.Font.Style);
    Console.WriteLine("Ascending/Descending: " + criterion.Ascending);
}

See Also