# Task Deadline

## Content



GanttView allows you to define the deadline of a task, which indicates the time by which a task must be completed. To specify the task deadline, you can use the **Deadline** property of the <span data-popup-content="This class is available in \u003ca href=\u0022/componentone/docs/win/online-ganttview/\u0022\u003e.NET\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-ganttview/\u0022\u003e.NET Framework\u003c/a\u003e." data-popup-title="Task" data-popup-theme="ui-tooltip-green qtip-green">Task</span> class.

If your Finish date time exceeds your Deadline date time, a red indicator will appear next to the task number like the following:

![Displays the red indicator that appears when a task exceeds its deadline.](https://cdn.mescius.io/document-site-files/images/7e40233e-00f6-4cd8-af13-0764ef4e9235/images/taskdeadlinenew.png)

Below code snippet shows how you can set the deadline of a task in GanttView.

```csharp
//Set the deadline of a task
Task1.Deadline = new DateTime(2021, 06, 7);
```