# gantt-holidays

> Gantt chart displaying configured holidays alongside tasks and working time settings.

**Framework:** aspnet-mvc  **Component:** Gantt  **Variant:** holidays

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/aspnet-mvc/gantt-holidays.json
```

**Install Package(s)**

```bash
Install-Package Syncfusion.AspNetMvc.Gantt
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/gantt-holidays/Gantt.cshtml

```cshtml
@using Syncfusion.EJ2
@{
    ViewData["Title"] = "Holidays";
}

@section ControlsSection{
    <div class="control-section">
        <div class="content-wrapper">
            @(Html.EJS().Gantt("Holidays").DataSource((IEnumerable<object>)ViewData["DataSource"]).Height("450px").HighlightWeekends(true).AllowSelection(true)
                .TaskFields(ts => ts.Id("TaskId").Name("TaskName").StartDate("StartDate").EndDate("EndDate").Duration("Duration").Progress("Progress")
                .Dependency("Predecessor").Child("SubTasks")).TreeColumnIndex(1)
                .Columns(col =>
                {
                    col.Field("TaskId").Width(80).Add();
                    col.Field("TaskName").Width(250).Add();
                    col.Field("StartDate").Add();
                    col.Field("EndDate").Add();
                    col.Field("Duration").Add();
                    col.Field("Predecessor").Add();
                    col.Field("Progress").Add();
                })
                .Holidays(hol => {
                    hol.From("04/04/2024").To("04/04/2024").Label("Local Holiday").Add();
                    hol.From("04/19/2024").To("04/19/2024").Label("Good Friday").Add();
                    hol.From("04/30/2024").To("04/30/2024").Label("Release Holiday").Add();
                })
                .LabelSettings(ls => ls.LeftLabel("TaskName"))
                .ProjectStartDate("03/24/2024")
                .ProjectEndDate("07/06/2024")
                .Render()
            )
        </div>
    </div>
}
```

### src/components/gantt-holidays/GanttController.cs

```cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EJ2MVCSampleBrowser.Models;

namespace EJ2MVCSampleBrowser.Controllers.Gantt
{
    public partial class GanttChartController : Controller
    {
        // GET: Gantt
        public ActionResult Holidays()
        {
            ViewData["DataSource"] = GanttData.ProjectNewData();
            return View("~/Views/Home/gantt/holidays/Gantt.cshtml");
        }
    }
}
```
