Back to Devexpress

GanttDependencyMappings.SuccessorFieldName Property

windowsforms-devexpress-dot-xtragantt-dot-ganttdependencymappings-e09b1896.md

latest6.2 KB
Original Source

GanttDependencyMappings.SuccessorFieldName Property

Gets or sets the data source field that specifies a task’s successor. Use a task’s key to specify the successor.

Namespace : DevExpress.XtraGantt

Assembly : DevExpress.XtraGantt.v25.2.dll

NuGet Package : DevExpress.Win.Gantt

Declaration

csharp
[DefaultValue("SuccessorID")]
[DXCategory("Mappings")]
[XtraSerializableProperty]
public string SuccessorFieldName { get; set; }
vb
<DXCategory("Mappings")>
<DefaultValue("SuccessorID")>
<XtraSerializableProperty>
Public Property SuccessorFieldName As String

Property Value

TypeDefaultDescription
String"SuccessorID"

The data source field that specifies a task’s successor.

|

Remarks

The KeyFieldName property specifies the data field that stores a task’s unique identifier (key). These keys are used to specify dependencies between tasks.

Finish-to-Start Dependencies

The control’s DataSource property allows you to bind the control to a data source. The ChartMappings property provides access to data fields mapped to task properties that specify how a task is displayed in the chart area. The PredecessorsFieldName property specifies the data field that stores keys of task predecessors. Note that this data field allows you to specify finish-to-start dependencies only without time lag.

csharp
ganttControl1.ChartMappings.PredecessorsFieldName = "Predecessors";
vb
ganttControl1.ChartMappings.PredecessorsFieldName = "Predecessors"

The data field can be of the following types:

  • String — the string should contain keys separated by space, comma, or semicolon (‘ ‘, ‘,’ ‘;’).

  • IEnumerable — the enumerator should return key values of the same type as the key field.

Dependencies of Any Types

The DependencySource property allows you to bind the control to a data source that can store dependencies. Note that this additional data source allows you to specify dependencies of any type (finish-to-start, finish-to-finish, and so on) and any time lags.

If the data source contains multiple tables, use the DataMember property to specify the table that contains dependencies.

The DependencyMappings property allows you to specify data fields that should be mapped to dependency properties:

csharp
ganttControl1.DependencyMappings.PredecessorFieldName = "Predecessor";
ganttControl1.DependencyMappings.SuccessorFieldName = "Successor";
ganttControl1.DependencyMappings.TypeFieldName = "Type";
ganttControl1.DependencyMappings.LagFieldName = "Lag";
vb
ganttControl1.DependencyMappings.PredecessorFieldName = "Predecessor"
ganttControl1.DependencyMappings.SuccessorFieldName = "Successor"
ganttControl1.DependencyMappings.TypeFieldName = "Type"
ganttControl1.DependencyMappings.LagFieldName = "Lag"

See the following topic for more information: Task Dependencies.

Obtain or Set Dependencies in Code

Use the following methods to obtain an object that contains data for a specific dependency:

To specify the node in the method’s parameter, use the node’s Id property value.

The SetDependency(GanttControlNode, GanttControlNode, DependencyType, TimeSpan) method allows you to specify a dependency in code.

See Also

GanttDependencyMappings Class

GanttDependencyMappings Members

DevExpress.XtraGantt Namespace