# scheduler-timeline-grouping

> Scheduler displays timeline appointments grouped by departments and assigned resources.

**Framework:** aspnet-mvc  **Component:** Scheduler  **Variant:** timeline-grouping

## 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/scheduler-timeline-grouping.json
```

**Install Package(s)**

```bash
Install-Package Syncfusion.AspNetMvc.Schedule
```

**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/scheduler-timeline-grouping/Scheduler.cshtml

```cshtml
@using Syncfusion.EJ2
@using Syncfusion.EJ2.Schedule

@section ControlsSection{
    <div class="control-section">
        <div class="content-wrapper">
            @Html.EJS().Schedule("schedule").Width("100%").Height("650px").CurrentView(View.TimelineWeek).Views(view => { view.Option(View.TimelineDay).Add(); view.Option(View.TimelineWeek).Add(); view.Option(View.TimelineWorkWeek).Add(); view.Option(View.TimelineMonth).Add(); view.Option(View.Agenda).Add(); }).Group(group => group.Resources((string[])ViewData["Resources"])).Resources(res =>
            {
                res.DataSource(ViewData["Projects"]).Field("ProjectId").Title("Choose Project").Name("Projects").TextField("text").IdField("id").ColorField("color").Add();
                res.DataSource(ViewData["Categories"]).Field("TaskId").Title("Category").Name("Categories").TextField("text").IdField("id").GroupIDField("groupId").ColorField("color").AllowMultiple(true).Add();
            }).EventSettings(e => e.Fields(f => f.Subject(sub => sub.Name("Subject").Title("Summary")).Description(des => des.Name("Description").Title("Comments"))).DataSource(ViewData["datasource"])).SelectedDate(new DateTime(DateTime.Today.Year, 4, 4)).WorkDays((int[])ViewData["workDays"]).Render()
        </div>
    </div>
    <style type="text/css">
        .e-schedule:not(.e-device) .e-agenda-view .e-content-wrap table td:first-child {
            width: 90px;
        }

        .e-schedule .e-agenda-view .e-resource-column {
            width: 100px;
        }
    </style>
}

```

### src/components/scheduler-timeline-grouping/SchedulerController.cs

```cs
using EJ2MVCSampleBrowser.Models;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;

namespace EJ2MVCSampleBrowser.Controllers.Schedule
{
    public partial class ScheduleController : Controller
    {
        public ActionResult TimelineResourceGroup()
        {
            ScheduleData data = new ScheduleData();
            List<ScheduleData.ResourceData> resourceData = data.GetResourceData();
            List<ScheduleData.ResourceData> timelineResourceData = data.GetTimelineResourceData();
            ViewData["datasource"] = resourceData.Concat(timelineResourceData);

            List<ResourceDataSourceModel> projects = new List<ResourceDataSourceModel>();
            projects.Add(new ResourceDataSourceModel { text = "PROJECT 1", id = 1, color = "#cb6bb2" });
            projects.Add(new ResourceDataSourceModel { text = "PROJECT 2", id = 2, color = "#56ca85" });
            ViewData["Projects"] = projects;

            List<ResourceDataSourceModel> categories = new List<ResourceDataSourceModel>();
            categories.Add(new ResourceDataSourceModel { text = "Nancy", id = 1, groupId = 1, color = "#df5286" });
            categories.Add(new ResourceDataSourceModel { text = "Steven", id = 2, groupId = 1, color = "#7fa900" });
            ViewData["Categories"] = categories;

            ViewData["Resources"] = new string[] { "Projects", "Categories" };
            ViewData["workDays"] = new int[] { 0, 1, 2, 3, 4, 5 };
            return View("~/Views/Home/scheduler/timeline-grouping/Scheduler.cshtml");
        }
    }
}
```
