Gantt View Specifics

  • 2 minutes to read

The Gantt View requires an additional table containing dependencies between appointments (referred to as 'tasks' in the Gantt view). This table should be mapped to a Scheduler storage in the same way as tables for Appointments and Resources (using the AppointmentDependencyStorage.Mappings property at runtime or the corresponding mappings Wizard at design time).

NOTE

To learn more about creating the Gantt application, see the How to: Create a Gantt Chart Application document.

The ParentId field specifies the ID of the appointment that is at the tail of the dependency arrow. The DependentId field specifies the ID of the appointment that is at the head of the dependency arrow. The Type field holds the AppointmentDependencyType enumeration member.

The following image shows two appointments with ID=22 and ID=23, linked with a FinishToStart dependency. The data record from the TaskDependencies table demonstrates that the appointment with ID=22 is the Parent appointment, the appointment with ID=23 is the Dependent appointment, and the integer value of the AppointmentDependencyType.FinishToStart enumeration is 0.

Dependency-FinishToStart

The MS SQL Server script below enables you to create Appointments, Resources and TaskDependencies tables that contain the required fields.


CREATE TABLE [dbo].[TaskDependencies](
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [ParentId] [int] NULL,
    [DependentId] [int] NULL,
    [Type] [int] NOT NULL,
 CONSTRAINT [PK_TaskDependencies] PRIMARY KEY CLUSTERED 
(
    [Id] ASC
)
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Resources](
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [IdSort] [int] NULL,
    [ParentId] [int] NULL,
    [Description] [nvarchar](max) NULL,
    [Color] [int] NULL,
    [Image] [image] NULL,
    [CustomField1] [nvarchar](max) NULL,
 CONSTRAINT [PK_Resources] PRIMARY KEY CLUSTERED 
(
    [Id] ASC
)
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Appointments](
    [UniqueId] [int] IDENTITY(1,1) NOT NULL,
    [Type] [int] NULL,
    [StartDate] [smalldatetime] NULL,
    [EndDate] [smalldatetime] NULL,
    [AllDay] [bit] NULL,
    [Subject] [nvarchar](max) NULL,
    [Location] [nvarchar](max) NULL,
    [Description] [nvarchar](max) NULL,
    [Status] [int] NULL,
    [Label] [int] NULL,
    [ResourceId] [int] NULL,
    [ResourceIds] [nvarchar](max) NULL,
    [ReminderInfo] [nvarchar](max) NULL,
    [RecurrenceInfo] [nvarchar](max) NULL,
    [PercentComplete] [int] NULL,
    [TimeZoneId] [nvarchar](max) NULL,
    [CustomField1] [nvarchar](max) NULL,
 CONSTRAINT [PK_Appointments] PRIMARY KEY CLUSTERED 
(
    [UniqueId] ASC
)
) ON [PRIMARY]
GO
INSERT INTO Resources Values (
1,
null,
'Description',
null,
null,
'CustomField1'
)
GO
See Also