# gantt-resource-view

> Gantt chart showing project tasks organized by assigned resources and resource groups.

**Framework:** aspnet-mvc  **Component:** Gantt  **Variant:** resource-view

## 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-resource-view.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-resource-view/Gantt.cshtml

```cshtml
@{
    ViewData["Title"] = "ResourceView";
}

@section ControlsSection{
    <div class="control-section">
        <div class="content-wrapper">
           @{
                List<object> toolbarItems = new List<object>();
                toolbarItems.Add("Add");
                toolbarItems.Add("Edit");
                toolbarItems.Add("Update");
                toolbarItems.Add("Delete");
                toolbarItems.Add("Cancel");
                toolbarItems.Add("ExpandAll");
                toolbarItems.Add("CollapseAll");
                toolbarItems.Add(new { text = "Show/Hide Overallocation", tooltipText = "Show/Hide Overallocation", id = "showhidebar" });
            }
            @(Html.EJS().Gantt("ResourceView").DataSource((IEnumerable<object>)ViewData["DataSource"]).Height("450px")
                .ViewType(Syncfusion.EJ2.Gantt.ViewType.ResourceView).HighlightWeekends(true).AllowSelection(true).AllowResizing(true)
                .ShowOverAllocation(true).ToolbarClick("ToolbarClick").Toolbar(toolbarItems).TaskType(Syncfusion.EJ2.Gantt.TaskType.FixedWork)
                .TaskFields(ts => ts.Id("TaskId").Name("TaskName").Work("Work").StartDate("StartDate").EndDate("EndDate")
                .Duration("Duration").Progress("Progress").Dependency("Predecessor").ResourceInfo("Resources").Child("SubTasks"))
                .TreeColumnIndex(1).ResourceFields(rf => rf.Id("ResourceId").Name("ResourceName").Unit("ResourceUnit").Group("ResourceGroup"))
                .EditSettings(es => es.AllowAdding(true).AllowEditing(true).AllowDeleting(true).AllowTaskbarEditing(true)
                .ShowDeleteConfirmDialog(true)).Resources((IEnumerable<object>)ViewData["Resources"])
                .Columns(col =>
                {
                    col.Field("TaskId").Visible(false).Add();
                    col.Field("TaskName").HeaderText("Name").Width(250).Add();
                    col.Field("Work").HeaderText("Work").Add();
                    col.Field("Progress").Add();
                    col.Field("ResourceGroup").HeaderText("Group").Add();
                    col.Field("StartDate").Width(100).Add();
                    col.Field("Duration").Width(100).Add();
                })
                .LabelSettings(ls => ls.RightLabel("Resources").TaskLabel("Progress")).SplitterSettings(sp => sp.ColumnIndex(3))
                .ProjectStartDate("03/28/2024").ProjectEndDate("05/18/2024")
                .Render()
            )
            <script>
                function ToolbarClick(args) {
                    if (args.item.id === 'showhidebar') {
                        var ganttObj = document.getElementById("ResourceView").ej2_instances[0];
                        ganttObj.showOverAllocation = ganttObj.showOverAllocation ? false : true;
                    }
                };
            </script>
        </div>
    </div>
}

```

### src/components/gantt-resource-view/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 ResourceView()
        {
            ViewData["DataSource"] = GanttData.ResourceViewData();
            ViewData["Resources"] = GanttData.GetResourceGroup();
            return View("~/Views/Home/gantt/resource-view/Gantt.cshtml");
        }
    }
}
```
