Version

Using xamGantt Commands

Topic Overview

Purpose

This topic describes many of the more commonly used commands available in the xamGantt™ control and how to use them.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

This topic describes how you can add the xamGantt control to a page.

xamGantt Commands Reference

Introduction

The xamGantt control provides a set of commands for performing some common user operations such as inserting and deleting tasks, scrolling, indenting and outdenting and many more.

The following table lists, xamGantt’s more commonly used commands. For more information, check the full list in the API documentation ( GanttCommandId Enumeration).

Commands reference chart

The following table summarizes the purpose and functionality of the xamGantt control’s more commonly used commands.

Command Corresponding user action

Adds a new child task to the selected task.

Adds a new sibling task below the selected task.

Calculates the project explicitly (for example, disabling the xamGantt’s automatically project calculations control.

Activates the selected task(s).

Changes the task(s) mode to auto scheduled.

Inactivates the selected task(s).

Changes the task(s) mode to manually scheduled.

Resets the sorted column to its initial order.

Deletes the selected task(s).

Collapses the selected summary task(s).

Indents the selected task.

Inserts a new task above the selected task.

Outdents the selected task.

Determines the tasks scheduling explicitly by the tasks dependencies.

Scrolls the timescale so the project finish date is visible.

Scrolls the timescale so the project start date is visible.

Scrolls the timescale so the task finish date is visible.

Scrolls the timescale so the task start date is visible.

Expands the selected summary task(s).

Alternates the selected task(s) state between active and inactive.

Code Example: Inserting and Deleting Tasks in xamGantt Using Commands

Description

The following code explains how to use xamGantt commands to insert and delete tasks.

Code

Add the following namespaces in your page:

In XAML:

xmlns:ig="http://schemas.infragistics.com/xaml"
xmlns:igPrim="http://schemas.infragistics.com/xaml/primitives"

The code below adds a xamGantt and two buttons to your page to perform inserting and deleting tasks using commands.

In XAML:

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="22" />
    </Grid.RowDefinitions>
    <ig:XamGantt x:Name="gantt" Project="{Binding}" />
        <StackPanel Grid.Row="1" Orientation="Horizontal">
            <Button x:Name="Btn_InsertTask" Content="Insert Task">
                <ig:Commanding.Command>
                    <igPrim:GanttCommandSource
                        TargetName="gantt"
                        CommandType="InsertTask"
                        EventName="Click"/>
                </ig:Commanding.Command>
            </Button>
            <Button x:Name="Btn_DeleteTask" Content="Delete Task">
                <ig:Commanding.Command>
                    <igPrim:GanttCommandSource
                        TargetName="gantt"
                        CommandType="DeleteTask"
                        EventName="Click"/>
                </ig:Commanding.Command>
            </Button>
        </StackPanel>
</Grid>

Related Topics

The following topics provide additional information related to this topic.

Topic Purpose

The topics in this group explain the main configurable aspects of the xamGantt control.