Version

EndDateTime Property (Task)

Returns or sets the DateTime at which the task ends.
Syntax
'Declaration
 
Public Property EndDateTime As Date
public DateTime EndDateTime {get; set;}
Exceptions
ExceptionDescription
SummaryTaskExceptionThrown when the property value is changed for a summary task.
Remarks

When a task is a summary, The EndDateTime cannot be changed, as it is then defined by the earliest subtask. Attempting to change the value of the EndDateTime property when the task is a summary will cause a SummaryTaskException to be thrown.

Setting the EndDateTime property causes the Constraint property to be set to 'FinishNoEarlierThan'.

When a value is assigned to the EndDateTime property, the current value of the Duration property is subtracted from the assigned value, and the StartDateTime property is assigned the result of that subtraction. To extend the end date/time of a task without affecting the start date/time, assign the desired value to the Duration property

The Constraint property supercedes the value assigned to the EndDateTime property in that when a constraint other than 'FinishNoEarlierThan' is in effect, the task's actual end date/time is determined by the constraint rather than the value assigned to the EndDateTime property. The EndDateTime property returns this "resolved" value, so under certain constraint settings, the EndDateTime property can return a different value than that to which it was last set by the developer.

Note that the value returned from the EndDateTime property represents the first significant instant of time that follows the end of the task. For example, if the StartDateTime of a task is assigned a value of 'Jan 1, 2011', and the Duration property is set to exactly one day, the EndDateTime property will return 'Jan 2, 2011'. The EndDateTimeResolved property in this example would return 'Jan 1, 2011, 11:59:59 PM', to indicate that the task spans through the latest part of the day, but does not intersect with the actual value of EndDateTime. The motivation for this behavior is so that when the task is displayed in the task grid used by the UltraGanttView control, the 'Finish' column displays the same date as the 'Start' column when the task spans exactly one day. To eliminate the need for the end developer to remove one second from the value assigned to the property, the task grid displays the value of the EndDateTimeResolved property, and rounds these values up to the nearest whole minute before assigning them to the EndDateTime property.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also