Back to Devexpress

GanttValidationSettings Class

aspnet-devexpress-dot-web-dot-aspxgantt-864d8cdc.md

latest8.5 KB
Original Source

GanttValidationSettings Class

Contains validation settings.

Namespace : DevExpress.Web.ASPxGantt

Assembly : DevExpress.Web.ASPxGantt.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public class GanttValidationSettings :
    GanttSettingsBase
vb
Public Class GanttValidationSettings
    Inherits GanttSettingsBase

The following members return GanttValidationSettings objects:

LibraryRelated API Members
ASP.NET Web Forms ControlsASPxGantt.SettingsValidation
ASP.NET MVC ExtensionsGanttSettings.SettingsValidation

Remarks

ASPxGantt allows you to validate relationships between tasks when they are edited.

Run Demo: ASPxGantt - Validation Run Demo: MVCxGantt - Validation

Dependency Rules Validation

The Gantt control supports the following dependency types:

|

Dependency Type

|

Dependency Rule

| | --- | --- | |

Finish to Start (FS)

|

A successor task’s start point should be equal or later than the preceding task’s end point.

| |

Start to Start (SS)

|

A successor task’s start point should be equal or later than the preceding task’s start point.

| |

Finish to Finish (FF)

|

A successor task’s end point should be equal or later than the preceding task’s end point.

| |

Start to Finish (SF)

|

A successor task’s end point should be equal or later than a preceding task’s start point.

|

Users actions can violate the dependency rules. The following table demonstrates how ASPxGantt handles these situations:

|

User Action

|

Dependency Type

|

Gantt’s Reaction

| | --- | --- | --- | |

Move a predecessor task (Task 1) to the left or right.

|

Finish to Start (FS):

Start to Start (SS):

Start to Finish (SF):

Finish to Finish (FF):

|

The control moves a successor task (Task 2) forward or backward to the same time interval.

| |

Move a successor task (Task 2) to the left.

|

Finish to Start (FS):

Start to Start (SS):

Start to Finish (SF):

Finish to Finish (FF):

|

The control suggests the following actions in the pop-up window:

  • Do nothing.
  • Delete the dependency.

| |

Move a successor task (Task 2) to the right.

|

Finish to Start (FS):

Start to Start (SS):

Start to Finish (SF):

Finish to Finish (FF):

|

The control suggests the following actions in the pop-up window:

  • Do nothing.
  • Delete the dependency.
  • Move the task and keep the dependency.
    This action creates a gap between tasks. Note that you can move a successor task forward/backward within this gap and resize it while the dependency rules are not violated.

|

Set the EnableDependencyValidation property to true to enable dependency rules validation.

Web Forms:

aspx
<dx:ASPxGantt ID="Gantt" >
    ...
    <SettingsValidation EnableDependencyValidation="true" />
</dx:ASPxGantt>

MVC:

cshtml
@Html.DevExpress().Gantt(settings => {
    settings.Name = "gantt";
    settings.SettingsValidation.EnableDependencyValidation = true;
    ...
}).Bind(
    GanttDataProvider.Tasks, 
    GanttDataProvider.Dependencies, 
    GanttDataProvider.Resources, 
    GanttDataProvider.ResourceAssignments
).GetHtml()

According to the dependency rules described above, the Gantt control allows you to change the gap between tasks only if you move or resize the successor task.

You can set the EnablePredecessorGap property to true to enable this functionality for the predecessor.

aspx
<dx:ASPxGantt ID="Gantt" runat="server" ClientInstanceName="clientGantt" EnableViewState="false" ...>
    <SettingsValidation EnableDependencyValidation="true" EnablePredecessorGap="true" />
    <!--...-->
</dx:ASPxGantt>

Parent-Child Relationship Validation

The Gantt control supports the following rules for parent&child relationship validation:

  • A parent task’s duration equals a summary duration of its child tasks.
  • A parent task and its first child start at the same time.
  • A parent task and its last child end at the same time.
  • A parent task’s progress is a summary progress of its child tasks.

Set the AutoUpdateParentTasks property to true to enable validation for parent&child relationships.

Web Forms:

aspx
<dx:ASPxGantt ID="Gantt" >
    ...
    <SettingsValidation AutoUpdateParentTasks="true" />
</dx:ASPxGantt>

MVC:

cshtml
@Html.DevExpress().Gantt(settings => {
    settings.Name = "gantt";
    settings.SettingsValidation.AutoUpdateParentTasks = true;
    ...
}).Bind(
    GanttDataProvider.Tasks, 
    GanttDataProvider.Dependencies, 
    GanttDataProvider.Resources, 
    GanttDataProvider.ResourceAssignments
).GetHtml()

Note

When the EnableDependencyValidation and AutoUpdateParentTasks properties are enabled, the Gantt does not allow users to specify dependencies between a child task and its parent, regardless of the child’s nesting level.

Concepts

Implements

IStateManager

Inheritance

Object StateManager PropertiesBase GanttSettingsBase GanttValidationSettings

See Also

GanttValidationSettings Members

ASPxGantt - 'How To' Examples

DevExpress.Web.ASPxGantt Namespace