{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "gantt-resource-view",
  "framework": "blazor",
  "type": "registry:component",
  "component": "Gantt",
  "variant": "resource-view",
  "dependencies": [
    "Syncfusion.Blazor.Gantt"
  ],
  "description": "Resource-view Gantt assigns tasks to resources, supports row drag-and-drop and editing, and displays work and progress labels.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 2 (v34.1.29)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/blazor/llms.txt",
    "skillPack": "syncfusion/blazor-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/blazor/gantt-resource-view.md"
  },
  "files": [
    {
      "target": "src/components/gantt-resource-view/DataSource.cs",
      "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nnamespace BlazorDemos.Pages.GanttChart.Data\n{\n    internal sealed class ResourceViewData\n    {\n        public sealed class TaskData\n        {\n            public int Id { get; set; }\n            public string Name { get; set; } = string.Empty;\n            public DateTime StartDate { get; set; }\n            public DateTime? EndDate { get; set; }\n            public string? Duration { get; set; }\n            public int Progress { get; set; }\n            public int? ParentId { get; set; }\n            public string Predecessor { get; set; } = string.Empty;\n            public string Notes { get; set; } = string.Empty;\n            public double? Work { get; set; }\n            public string TaskType { get; set; } = string.Empty;\n            public DateTime BaselineStartDate { get; set; }\n            public DateTime BaselineEndDate { get; set; }\n            public string? Details { get; set; }\n        }\n        public sealed class ResourceInfoModel\n        {\n            public int Id { get; set; }\n            public string Name { get; set; } = string.Empty;\n            public double MaxUnit { get; set; }\n            public string? Group { get; set; }\n        }\n        public sealed class AssignmentModel\n        {\n            public int Id { get; set; }\n            public int TaskId { get; set; }\n            public int ResourceId { get; set; }\n            public double? Unit { get; set; }\n        }\n        public static List<ResourceInfoModel> GetResources = new List<ResourceInfoModel>()\n        {\n            new ResourceInfoModel() { Id= 1, Name= \"Martin Tamer\", Group=\"Planning Team\"},\n            new ResourceInfoModel() { Id= 2, Name= \"Rose Fuller\", Group=\"Testing Team\" },\n            new ResourceInfoModel() { Id= 3, Name= \"Margaret Buchanan\", Group=\"Approval Team\" },\n            new ResourceInfoModel() { Id= 4, Name= \"Fuller King\", Group=\"Development Team\" },\n            new ResourceInfoModel() { Id= 5, Name= \"Davolio Fuller\", Group=\"Approval Team\" },\n            new ResourceInfoModel() { Id= 6, Name= \"Fuller Buchanan\", Group=\"Development Team\" },\n        };\n        /// <summary>\n        /// Returns a list of predefined tasks for the resource view sample.\n        /// </summary>\n        public static List<TaskData> GetTaskCollection()\n        {\n            List<TaskData> Tasks = new List<TaskData>() {\n                new TaskData() { Id = 1, Name = \"Project initiation\", StartDate = new DateTime(2022, 03, 28), EndDate = new DateTime(2022, 07, 28), TaskType =\"FixedDuration\", Work=128, Duration=\"4\" },\n                new TaskData() { Id = 2, Name = \"Identify Site location\", StartDate = new DateTime(2022, 03, 29), BaselineStartDate = new DateTime(2022, 03, 29), BaselineEndDate= new DateTime(2022, 03, 31),  Progress = 30, ParentId = 1, Duration=\"5\", Work=16 },\n                new TaskData() { Id = 3, Name = \"Site analyze\", StartDate = new DateTime(2022, 03, 29), BaselineStartDate = new DateTime(2022, 03, 29), BaselineEndDate= new DateTime(2022, 03, 31),  Progress = 50, ParentId = 1, Duration=\"5\", Work=16 },\n                new TaskData() { Id = 4, Name = \"Perform soil test\", StartDate = new DateTime(2022, 03, 29), ParentId = 1, Work=96, Duration=\"6\", TaskType=\"FixedWork\", Predecessor=\"2FS\", Progress=40 },\n                new TaskData() { Id = 5, Name = \"Soil test approval\", StartDate = new DateTime(2022, 03, 29), BaselineStartDate= new DateTime(2022, 03, 29), BaselineEndDate= new DateTime(2022, 03, 31), Duration=\"4\", Progress = 30, ParentId = 1, Work=16, TaskType=\"FixedWork\" },\n                new TaskData() { Id = 6, Name = \"Project estimation\", StartDate = new DateTime(2022, 03, 29), EndDate = new DateTime(2022, 04, 2), TaskType=\"FixedDuration\", Duration=\"7\", Progress=40, Work=50 },\n            };\n            return Tasks;\n        }\n        /// <summary>\n        /// Returns a list of predefined resource assignments.\n        /// </summary>\n        public static List<AssignmentModel> GetAssignmentCollection()\n        {\n            List<AssignmentModel> assignments = new List<AssignmentModel>()\n            {\n                new AssignmentModel(){ Id=1, TaskId = 2 , ResourceId=1, Unit=70},\n                new AssignmentModel(){ Id=2, TaskId = 3 , ResourceId=1, Unit=70},\n                new AssignmentModel(){ Id=3, TaskId = 4 , ResourceId=3},\n                new AssignmentModel(){ Id=4, TaskId = 5 , ResourceId=8},\n                new AssignmentModel(){ Id=5, TaskId = 6 , ResourceId=2},\n            };\n            return assignments;\n        }\n    }\n}"
    },
    {
      "target": "src/components/gantt-resource-view/Gantt.razor",
      "content": "@page \"/gantt-chart/resource-view\"\n@using Syncfusion.Blazor.Gantt\n@using Syncfusion.Blazor.Navigations\n@using BlazorDemos.Pages.GanttChart.Data\n\n<div class=\"control-section e-gantt-resource-view-sample\">\n    <SfGantt @ref=\"GanttInstance\" DataSource=\"@TaskCollection\" Height=\"100%\" Width=\"1200px\" ShowOverallocation=\"@ShowOverallocation\" TreeColumnIndex=\"1\" AllowRowDragAndDrop=\"true\" RowHeight=\"37\"\n\t\t\t Toolbar=\"@ToolbarItems\" AllowResizing ViewType=\"@viewType\">\n\t\t<GanttTaskFields Id=\"Id\" Name=\"Name\" StartDate=\"StartDate\" EndDate=\"EndDate\" Duration=\"Duration\" Progress=\"Progress\"\n\t\t\t\t\t\t ParentID=\"ParentId\" Work=\"Work\" Dependency=\"Predecessor\">\n\t\t</GanttTaskFields>\n\t\t<GanttResource DataSource=\"ResourceCollection\" Id=\"Id\" Name=\"Name\" MaxUnits=\"MaxUnit\" Group=\"Group\" TValue=\"ResourceViewData.TaskData\" TResources=\"ResourceViewData.ResourceInfoModel\"></GanttResource>\n\t\t<GanttAssignmentFields DataSource=\"AssignmentCollection\" PrimaryKey=\"Id\" TaskID=\"TaskId\" ResourceID=\"ResourceId\" TValue=\"ResourceViewData.TaskData\" TAssignment=\"ResourceViewData.AssignmentModel\"></GanttAssignmentFields>\n\t\t<GanttLabelSettings RightLabel=\"Resources\" TaskLabel=\"Progress\" TValue=\"ResourceViewData.TaskData\"></GanttLabelSettings>\n\t\t<GanttEditSettings AllowAdding=\"true\" AllowDeleting=\"true\" AllowEditing=\"true\" AllowTaskbarEditing=\"true\"></GanttEditSettings>\n\t\t<GanttColumns>\n\t\t\t<GanttColumn Field=\"Id\" Visible=false></GanttColumn>\n\t\t\t<GanttColumn Field=\"Name\" HeaderText=\"Name\" Width=\"250\"></GanttColumn>\n\t\t\t<GanttColumn Field=\"Work\" HeaderText=\"Work (Hours)\"></GanttColumn>\n\t\t\t<GanttColumn Field=\"Progress\"></GanttColumn>\n\t\t\t<GanttColumn Field=\"StartDate\" HeaderText=\"Start Date\"></GanttColumn>\n\t\t\t<GanttColumn Field=\"Duration\" HeaderText=\"Duration\"></GanttColumn>\n\t\t</GanttColumns>\n\t\t<GanttEvents OnToolbarClick=\"ToolbarClickHandler\" TValue=\"ResourceViewData.TaskData\"></GanttEvents>\n\t</SfGantt>\n</div>\n\n@code {\n    internal SfGantt<ResourceViewData.TaskData>? GanttInstance { get; set; }\n        internal List<ResourceViewData.TaskData> TaskCollection { get; set; } = new List<ResourceViewData.TaskData>();\n        internal List<ResourceViewData.ResourceInfoModel> ResourceCollection { get; set; } = new List<ResourceViewData.ResourceInfoModel>();\n        internal static List<ResourceViewData.AssignmentModel> AssignmentCollection { get; set; } = new List<ResourceViewData.AssignmentModel>();\n        internal List<Object>? ToolbarItems { get; set; }\n        public bool ShowOverallocation { get; set; } = true;\n        public bool IsCheck { get; set; } = true;\n        private ViewType viewType = ViewType.ResourceView;\n        /// <summary>\n        /// Initializes the sample by loading task, resource, and assignment data, and configuring the toolbar.\n        /// </summary>\n        protected override async Task OnInitializedAsync()\n        {\n            TaskCollection = ResourceViewData.GetTaskCollection();\n            ResourceCollection = ResourceViewData.GetResources;\n            AssignmentCollection = ResourceViewData.GetAssignmentCollection();\n            UpdateToolbar();\n            await Task.CompletedTask.ConfigureAwait(true);\n        }\n        /// <summary>\n        /// Handles toolbar button click events, toggling overallocation visibility.\n        /// </summary>\n        public void ToolbarClickHandler(ClickEventArgs args)\n        {\n            if (args is null)\n            {\n                return;\n            }\n            if (args.Item.Id == \"ShowHideBar\")\n            {\n                ShowOverallocation = ShowOverallocation ? false : true;\n            }\n        }\n        /// <summary>\n        /// Toggles between project view and resource view in the Gantt chart.\n        /// </summary>\n        public void Resource()\n        {\n            UpdateToolbar();\n            if (viewType == ViewType.ResourceView)\n            {\n                viewType = ViewType.ProjectView;\n            }\n            else\n            {\n                viewType = ViewType.ResourceView;\n            }\n            StateHasChanged();\n        }\n        /// <summary>\n        /// Updates the toolbar items based on the current view and overallocation settings.\n        /// </summary>\n        private void UpdateToolbar()\n        {\n#pragma warning disable BL0005 // Component parameter should not be set outside of its component.\n            ToolbarItems = new List<Object>() {\n            \"Add\", \"Cancel\", \"Update\", \"Delete\", \"Edit\", \"CollapseAll\", \"ExpandAll\",\n            new ToolbarItem() {\n                Text = \"Show/Hide Overallocation\",\n                TooltipText = \"Show/Hide Overallocation\",\n                Id = \"ShowHideBar\",\n                Visible = IsCheck,\n                PrefixIcon = \"e-icons e-eye\"\n            }\n        };\n#pragma warning restore BL0005 // Component parameter should not be set outside of its component.\n    }\n}"
    }
  ]
}