Essential Studio for Asp.Net | Demos

SHOWCASE SAMPLES
Showcase samples
    Gantt / CriticalPath
    <%@ Page Title="Gantt-Critical Path-ASP.NET-SYNCFUSION"   Language="C#" MetaDescription="This example illustrates how to identify the critical tasks and critical path in a project using the Syncfusion Gantt chart control." AutoEventWireup="true" CodeBehind="CriticalPath.aspx.cs" MasterPageFile="~/Samplebrowser.Master" Inherits="WebSampleBrowser.Gantt.CriticalPath" %>
    
    <asp:Content ID="Content1" ContentPlaceHolderID="SampleHeading" runat="server">
        <span class="sampleName">Gantt / CriticalPath</span>
    </asp:Content>
    
    <asp:Content ID="ControlContent" runat="server" ContentPlaceHolderID="ControlsSection">
    
        <div style="width: 100%; height: 100%; overflow: visible;">
            <ej:Gantt ID="GanttCriticalPathControl" ClientIDMode="Static" runat="server" AllowColumnResize="true" 
                TaskIdMapping="CriticalTaskID" TaskNameMapping="CriticalTaskName" StartDateMapping="CriticalStartDate"
                ProgressMapping="CriticalProgress" DurationMapping="CriticalDuration" EndDateMapping="CriticalEndDate"
                ChildMapping="CriticalSubTasks" EnableVirtualization="false"
                ScheduleStartDate="02/01/2017" ScheduleEndDate="03/14/2017"
                PredecessorMapping="CriticalPredecessors" ShowGridCellTooltip="true" TreeColumnIndex="1"
                IncludeWeekend="false" IsResponsive="true" AllowGanttChartEditing="true" Create="create" load="load" >
                <EditSettings AllowEditing="true" AllowAdding="true" AllowDeleting="true" AllowIndent="true" EditMode="cellEditing" />
                <ToolbarSettings ShowToolbar="true" ToolbarItems="criticalPath" />
                <SizeSettings Width="100%" Height="450px" />
            </ej:Gantt>
        </div>
    </asp:Content>
    <asp:Content ID="Content3" runat="server" ContentPlaceHolderID="ScriptSection">
        <script type="text/javascript">
        function create() {
            this.showCriticalPath(true);
        }
        function load(args) {
            var columns = { field: "isCritical", headerText: "Critical", allowEditing: false };
            var column = this.getColumns();
            column.splice(2, 0, columns);
            this.getColumns()[0].width = 60;
        }
     </script>
        </asp:Content>
    
    
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    namespace WebSampleBrowser.Gantt
    {
        public partial class CriticalPath : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                var DataSource = GetCriticalTaskData();
                this.GanttCriticalPathControl.DataSource = DataSource;
                this.GanttCriticalPathControl.DataBind();
            }
            public class CriticalTaskDetails
            {
                public int CriticalTaskID { get; set; }
                public string CriticalTaskName { get; set; }
                public string CriticalStartDate { get; set; }
                public string CriticalEndDate { get; set; }
                public int CriticalDuration { get; set; }
                public string CriticalProgress { get; set; }
                public List<CriticalTaskDetails> CriticalSubTasks { get; set; }
                public string CriticalPredecessors { get; set; }
            }
            public List<CriticalTaskDetails> GetCriticalTaskData()
            {
                List<CriticalTaskDetails> tasks = new List<CriticalTaskDetails>();
    
                tasks.Add(new CriticalTaskDetails()
                {
                    CriticalTaskID = 1,
                    CriticalTaskName = "Project Schedule",
                    CriticalStartDate = "02/06/2017",
                    CriticalEndDate = "03/10/2017"
                });
    
                tasks[0].CriticalSubTasks = new List<CriticalTaskDetails>();
    
                tasks[0].CriticalSubTasks.Add(new CriticalTaskDetails()
                {
                    CriticalTaskID = 2,
                    CriticalTaskName = "Planning",
                    CriticalStartDate = "02/06/2017",
                    CriticalEndDate = "02/10/2017"
                });
    
                tasks[0].CriticalSubTasks[0].CriticalSubTasks = new List<CriticalTaskDetails>();
    
    
                tasks[0].CriticalSubTasks[0].CriticalSubTasks.Add(new CriticalTaskDetails()
                {
                    CriticalTaskID = 3,
                    CriticalTaskName = "Plan timeline",
                    CriticalStartDate = "02/06/2017",
                    CriticalEndDate = "02/10/2017",
                    CriticalDuration = 5,
                    CriticalProgress = "80",
                    
                });
                tasks[0].CriticalSubTasks[0].CriticalSubTasks.Add(new CriticalTaskDetails()
                {
                    CriticalTaskID = 4,
                    CriticalTaskName = "Plan budget",
                    CriticalStartDate = "02/06/2017",
                    CriticalEndDate = "02/10/2017",
                    CriticalDuration = 5,
                    CriticalProgress = "70",
                    CriticalPredecessors = "3FS",
                    
                });
                tasks[0].CriticalSubTasks[0].CriticalSubTasks.Add(new CriticalTaskDetails()
                {
                    CriticalTaskID = 5,
                    CriticalTaskName = "Allocate resources",
                    CriticalStartDate = "02/06/2017",
                    CriticalEndDate = "02/10/2017",
                    CriticalDuration = 5,
                    CriticalProgress = "80",
                    CriticalPredecessors = "4SS",
                    
                });
                tasks[0].CriticalSubTasks[0].CriticalSubTasks.Add(new CriticalTaskDetails()
                {
                    CriticalTaskID = 6,
                    CriticalTaskName = "Planning complete",
                    CriticalStartDate = "02/10/2017",
                    CriticalEndDate = "02/10/2017",
                    CriticalDuration = 0,
                    CriticalPredecessors = "4FS",
                    
                });
    
                tasks[0].CriticalSubTasks.Add(new CriticalTaskDetails()
                {
                    CriticalTaskID = 7,
                    CriticalTaskName = "Design",
                    CriticalStartDate = "02/13/2017",
                    CriticalEndDate = "02/17/2017"
                });
    
                tasks[0].CriticalSubTasks[1].CriticalSubTasks = new List<CriticalTaskDetails>();
    
                tasks[0].CriticalSubTasks[1].CriticalSubTasks.Add(new CriticalTaskDetails()
                {
                    CriticalTaskID = 8,
                    CriticalTaskName = "Software Specification",
                    CriticalStartDate = "02/13/2017",
                    CriticalEndDate = "02/15/2017",
                    CriticalDuration = 3,
                    CriticalProgress = "60",
                    CriticalPredecessors = "6FS",
                    
                });
                tasks[0].CriticalSubTasks[1].CriticalSubTasks.Add(new CriticalTaskDetails()
                {
                    CriticalTaskID = 9,
                    CriticalTaskName = "Develop prototype",
                    CriticalStartDate = "02/13/2017",
                    CriticalEndDate = "02/15/2017",
                    CriticalDuration = 3,
                    CriticalProgress = "40",
                    CriticalPredecessors = "6FS",
                    
                });
                tasks[0].CriticalSubTasks[1].CriticalSubTasks.Add(new CriticalTaskDetails()
                {
                    CriticalTaskID = 10,
                    CriticalTaskName = "Get approval from customer",
                    CriticalStartDate = "02/16/2017",
                    CriticalEndDate = "02/21/2017",
                    CriticalDuration = 5,
                    CriticalProgress = "40",
                    CriticalPredecessors = "9FS",
                });
                tasks[0].CriticalSubTasks[1].CriticalSubTasks.Add(new CriticalTaskDetails()
                {
                    CriticalTaskID = 11,
                    CriticalTaskName = "Design complete",
                    CriticalStartDate = "02/21/2017",
                    CriticalEndDate = "02/24/2017",
                    CriticalDuration = 3,
                    CriticalPredecessors = "10FS",
                    
                });
                return tasks;
            }
        }
    }