GanttValidationSettings Class
Contains validation settings.
Namespace: DevExpress.Web.ASPxGantt
Assembly: DevExpress.Web.ASPxGantt.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
Related API Members
The following members return GanttValidationSettings objects:
Library | Related API Members |
---|---|
ASP.NET Web Forms Controls | ASPxGantt.SettingsValidation |
ASP.NET MVC Extensions | GanttSettings.SettingsValidation |
Remarks
ASPxGantt allows you to validate relationships between tasks when they are edited.
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): | 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): | The control suggests the following actions in the pop-up window:
|
Move a successor task (Task 2) to the right. | Finish to Start (FS): | The control suggests the following actions in the pop-up window:
|
Set the EnableDependencyValidation property to true
to enable dependency rules validation.
Web Forms:
<dx:ASPxGantt ID="Gantt" >
...
<SettingsValidation EnableDependencyValidation="true" />
</dx:ASPxGantt>
MVC:
@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.
<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:
<dx:ASPxGantt ID="Gantt" >
...
<SettingsValidation AutoUpdateParentTasks="true" />
</dx:ASPxGantt>
MVC:
@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.