Essential Studio for Asp.Net | Demos

SHOWCASE SAMPLES
Showcase samples
    Gantt / WBS
    <%@ Page Title="Gantt-Work Breakdown Structure-ASP.NET-SYNCFUSION"   Language="C#" MetaDescription="This example illustrates how to define a unique numbering system for the tasks based on hiearchy in the Syncfusion Gantt chart control." AutoEventWireup="true" MasterPageFile="~/Samplebrowser.Master" CodeBehind="GanttWBS.aspx.cs" Inherits="WebSampleBrowser.Gantt.GanttWBS" %>
    
    <asp:Content ID="Content1" ContentPlaceHolderID="SampleHeading" runat="server">
        <span class="sampleName">Gantt / WBS</span>
    </asp:Content>
    
    <asp:Content ID="ControlContent" runat="server" ContentPlaceHolderID="ControlsSection">
        <div>
            <ej:Gantt ID="GanttControlWBS" runat="server" AllowSelection="true" AllowColumnResize="true"
                TaskIdMapping="Id" TaskNameMapping="Name" ScheduleStartDate="02/23/2017" ScheduleEndDate="03/30/2017"
                StartDateMapping="StartDate" EndDateMapping="EndDate" ProgressMapping="PercentDone" IsResponsive="true"
                ChildMapping="Children" TreeColumnIndex="6" AllowGanttChartEditing="true" Load="Load"
                PredecessorMapping="Predecessor" EnableWBS="true" EnableWBSPredecessor="true" EnableContextMenu="true">
                <EditSettings AllowEditing="true" AllowAdding="true" AllowDeleting="true" AllowIndent="true" EditMode="cellEditing" />
                <ToolbarSettings ShowToolbar="true" ToolbarItems="add,edit,delete,update,cancel,indent,outdent,expandAll,collapseAll" />
                <SizeSettings Width="100%" Height="450px" />
            </ej:Gantt>
        </div>
        <script type="text/javascript">
            function Load() {
                var columns = this.getColumns();
                //Hide all(first 5) the columns except WBS and WBS predecessor
                for (var i = 0; i <= 5; i++)
                    columns[i].visible = false;
            }
        </script>
    </asp:Content>
    
    
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Syncfusion.JavaScript.Web;
    
    namespace WebSampleBrowser.Gantt
    {
        public partial class GanttWBS : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                var DataSource = this.GetDataSource();
                this.GanttControlWBS.DataSource = DataSource;
                this.GanttControlWBS.DataBind();
            }
            #region Create DataSource for Gantt control
            public List<BusinessObject> GetDataSource()
            {
                List<BusinessObject> list = new List<BusinessObject>();
                list.Add(new BusinessObject()
                {
                    Id = 1,
                    Name = "Parent Task 1",
                    StartDate = "02/27/2017",
                    EndDate = "03/03/2017",
                    PercentDone = "40",
                    Children = (new List<BusinessObject>()
                        {
                            new BusinessObject()
                            {
                                Id = 2,
                                Name = "Child Task 1",
                                StartDate = "02/27/2017",
                                EndDate="03/03/2017",
                                PercentDone = "40",
                            },
                            new BusinessObject()
                            {
                                Id = 3,
                                Name = "Child Task 2",
                                StartDate = "02/27/2017",
                                EndDate="03/03/2017",
                                PercentDone = "40"
                            },
                            new BusinessObject()
                            {
                                Id = 4,
                                Name = "Child Task 3",
                                StartDate = "02/27/2017",
                                EndDate="03/03/2017",
                                Duration = 5,
                                PercentDone = "40"
                            },
                            new BusinessObject()
                            {
                                Id = 5,
                                Name = "Child Task 4",
                                StartDate = "02/23/2014",
                                Duration = 0,
                                PercentDone = "40",
                                Predecessor = "3FS,4FS"
                            }
                        })
    
                });
    
                list.Add(new BusinessObject()
                {
                    Id = 6,
                    Name = "Parent Task 2",
                    StartDate = "03/06/2017",
                    EndDate = "03/10/2017",
                    PercentDone = "40",
                    Children = (new List<BusinessObject>()
                        {
                            new BusinessObject()
                            {
                                Id = 7,
                                Name = "Child Task 1",
                                StartDate = "03/06/2017",
                                EndDate = "03/10/2017",
                                PercentDone = "40",
                            },
                            new BusinessObject()
                            {
                                Id = 8,
                                Name = "Child Task 2",
                                StartDate = "03/06/2017",
                                EndDate = "03/10/2017",
                                PercentDone = "40",
                                Predecessor = "7FS"
                            },
                            new BusinessObject()
                            {
                                Id = 9,
                                Name = "Child Task 3",
                                StartDate = "03/06/2017",
                                EndDate = "03/10/2017",
                                PercentDone = "40",
                                Predecessor = "8FS"
                            },
                             new BusinessObject()
                            {
                                Id = 10,
                                Name = "Child Task 4",
                                StartDate = "03/06/2017",
                                PercentDone = "40",
                                Predecessor = "9FS"
                            }
                        })
    
                });
                list.Add(new BusinessObject()
                {
                    Id = 11,
                    Name = "Parent Task 3",
                    StartDate = "03/13/2017",
                    EndDate = "03/17/2017",
                    PercentDone = "40",
    
                    Children = (new List<BusinessObject>()
                        {
                            new BusinessObject()
                            {
    
                                Id = 12,
                                Name = "Child Task 1",
                                StartDate = "03/13/2017",
                                EndDate = "03/17/2017",
                                Duration = 5,
                                PercentDone = "40"
                            },
                            new BusinessObject()
                            {
                                Id = 13,
                                Name = "Child Task 2",
                                StartDate = "03/13/2017",
                                EndDate = "03/17/2017",
                                PercentDone = "40",
                            },
                            new BusinessObject()
                            {
                                Id = 14,
                                Name = "Child Task 3",
                                StartDate = "03/13/2017",
                                EndDate = "03/17/2017",
                                PercentDone = "40"
                            },
                             new BusinessObject()
                            {
                                Id = 15,
                                Name = "Child Task 3",
                                StartDate = "03/13/2017",
                                EndDate = "03/17/2017",
                                PercentDone = "40",
                                Predecessor = "12FS,13FS,14FS"
                            }
                        })
    
                });
    
                return list;
            }
            #endregion
            #region BusinessObject Creation
            public class BusinessObject
            {
                public string StartDate { get; set; }
                public string EndDate { get; set; }
                public int Id { get; set; }
                public string Name { get; set; }
                public int Duration { get; set; }
                public string PercentDone { get; set; }
                public List<object> ResourceID { get; set; }
                public List<BusinessObject> Children { get; set; }
                public string Predecessor { get; set; }
    
            }
            #endregion
        }
    }