Gantt Custom Columns

Thread is closed for posting
14 posts, 0 answers
  1. 63F75A2C-1F16-4AED-AFE8-B1BBD57646AD
    63F75A2C-1F16-4AED-AFE8-B1BBD57646AD avatar
    1572 posts
    Member since:
    Oct 2004

    Posted 26 Aug 2014 Link to this post

    Requirements

    Telerik Product and Version

    2014 Q2 SP1

    Supported Browsers and Platforms

    Firefox, Chrome, IE7+, Safari, .NET 4.5

    Components/Widgets used (JS frameworks, etc.)

    Entity Framework v5.0

    PROJECT DESCRIPTION 
    This Code Library demonstrates how to add Custom Task Column using a Custom EntityFramework Provider for the RadGantt.
  2. C64C0C13-F81B-4B04-9663-126E96122CCA
    C64C0C13-F81B-4B04-9663-126E96122CCA avatar
    89 posts
    Member since:
    Oct 2009

    Posted 15 Oct 2014 Link to this post

    Ok thats great article but is there is way we can add drop down in Gaint Chart
    Suppose we have scanner where we are looking for task assign to user  and we want to display all user name to drop down or checked drop down list

    Regards,
    Shakti
  3. 2AE2267E-E1A7-422B-B7E6-203D82592B69
    2AE2267E-E1A7-422B-B7E6-203D82592B69 avatar
    975 posts
    Member since:
    Jun 2016

    Posted 16 Oct 2014 Link to this post

    Hi Shakti,

    At the moment Gantt doesn't support drop downs. However we are working hard to improve this control and very soon will add such functionality.

    Regards,
    Hristo Valyavicharski
    Telerik
     
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
     
  4. 5D3D093C-4543-4A11-A834-BD1553699B13
    5D3D093C-4543-4A11-A834-BD1553699B13 avatar
    36 posts
    Member since:
    Feb 2015

    Posted 26 Feb 2015 in reply to 2AE2267E-E1A7-422B-B7E6-203D82592B69 Link to this post

    Hi,
    can I use dropdown as column in Gantt scheduler now? if so, appreciate if I get some sample example as it would be new.
    I want to give demo to my manager in prior to convince to purchase the telerik product for our next project.
  5. 5D3D093C-4543-4A11-A834-BD1553699B13
    5D3D093C-4543-4A11-A834-BD1553699B13 avatar
    36 posts
    Member since:
    Feb 2015

    Posted 26 Feb 2015 in reply to 2AE2267E-E1A7-422B-B7E6-203D82592B69 Link to this post

    Hi,
    can I add dropdown list in Gantt scheduler now? I am preparing demo for my manager in prior to purchase the telerik product.
    appreciate if I get quick example to use it as it would be new.
    thanks
  6. 2AE2267E-E1A7-422B-B7E6-203D82592B69
    2AE2267E-E1A7-422B-B7E6-203D82592B69 avatar
    975 posts
    Member since:
    Jun 2016

    Posted 03 Mar 2015 Link to this post

    Hi Rajshree,

    You will have to use Resources:

    http://demos.telerik.com/aspnet-ajax/gantt/examples/functionality/resources/defaultcs.aspx?isNew=true

    Regards,
    Hristo Valyavicharski
    Telerik
  7. D6AF2C09-133A-405D-BCAE-8CEE61D764F9
    D6AF2C09-133A-405D-BCAE-8CEE61D764F9 avatar
    2 posts
    Member since:
    Sep 2013

    Posted 22 Apr 2015 in reply to 63F75A2C-1F16-4AED-AFE8-B1BBD57646AD Link to this post

    Thank you for replying to my request.

    I am fiddling through this example trying to get the entity code to work with my project.

    Is there a sample somewhere of custom fields without using entity framework?

    I would be extremely appreciative if there was.  I have a dead line and this is taking too long to learn and convert.

    Thanks you again and have a great day.

    Dan Pratt

  8. 2AE2267E-E1A7-422B-B7E6-203D82592B69
    2AE2267E-E1A7-422B-B7E6-203D82592B69 avatar
    975 posts
    Member since:
    Jun 2016

    Posted 27 Apr 2015 Link to this post

    Hi Dan,

    At the moment we don't have other samples. But they will not be very different than the EF sample. You must override all methods of the GanttProviderBase abstract class. It doesn't if you will use SQL, EF or other ORM.

    Regards,
    Hristo Valyavicharski
    Telerik
  9. 998FE26D-35F0-415E-ABEC-7EEDAA74FFD5
    998FE26D-35F0-415E-ABEC-7EEDAA74FFD5 avatar
    1 posts
    Member since:
    Nov 2006

    Posted 12 Oct 2016 Link to this post

    Is there a way to add a custom Task without implementing a Custom EntityFramework Provider?  Are there plans to do so?
  10. E8D9975E-E106-47BA-B868-0EF340BFF55B
    E8D9975E-E106-47BA-B868-0EF340BFF55B avatar
    1 posts
    Member since:
    Mar 2016

    Posted 16 Oct 2016 Link to this post

    How can I download sample code because I cannot download from the link given?.
  11. E1AE8870-DB08-4F8D-894F-32C660AE72FA
    E1AE8870-DB08-4F8D-894F-32C660AE72FA avatar
    1 posts
    Member since:
    Nov 2016

    Posted 24 Nov 2016 in reply to 63F75A2C-1F16-4AED-AFE8-B1BBD57646AD Link to this post

    Why when Add Custom Filed is visible undefined, although defntion custom task filed and create Gannt Entity provider and Fill this Custom Filed in list when make Dubggigng.

    and kindly find attachments explain this Problems .

    Please Help.

    Best Regards,

    Mohammad Alshurafaa

  12. 9333A86F-98EC-4FD7-857A-812945BB83E0
    9333A86F-98EC-4FD7-857A-812945BB83E0 avatar
    3 posts
    Member since:
    Nov 2009

    Posted 22 Feb 2017 Link to this post

    Hi, 

    i try to ad custom column to RadGantt and seems that is not working as expected. can you help me out to solve the issue?

    here is default.aspx

    <asp:UpdatePanel ID="UpdatePanel" runat="server">
        <ContentTemplate>
             <telerik:RadGantt runat="server" ID="RadGantt1" SelectedView="MonthView" ReadOnly="true" AutoGenerateColumns="false" >
                 <Columns>
                     <telerik:GanttBoundColumn DataField="ID" Width="10px"></telerik:GanttBoundColumn>
                     <telerik:GanttBoundColumn DataField="Title" ></telerik:GanttBoundColumn>
                     <telerik:GanttBoundColumn DataField="ProjectLink" HeaderText="Project Link" DataType="String" UniqueName="PorjectLink"></telerik:GanttBoundColumn>
                 </Columns>
               
                 <CustomTaskFields>
                     <telerik:GanttCustomField PropertyName="ProjectLink" ClientPropertyName="projectlink" Type="String"   />
                 </CustomTaskFields>
            </telerik:RadGantt>

        </ContentTemplate>
    </asp:UpdatePanel>

     

    here is code.

      protected void Page_Load(object sender, EventArgs e)
            {

                GanttCustomField customField = new GanttCustomField();
                customField.Type = GanttCustomFieldType.String;
                customField.PropertyName = "ProjectLink";
                customField.ClientPropertyName = "projectlink";
                RadGantt1.CustomTaskFields.Add(customField);
                RadGantt1.Provider = new GanttProvider();
                
            }

     

    here is helper class

     

     

    public class ProgramTask : Task
        {
            public ProgramTask()
                : base()
            {
            }

            public string ProjectLink { get; set; }
           
            private ProgramTask ToEntityTask(ITask srcTask)
            {
                return new ProgramTask
                {
                    ID = (int)srcTask.ID,
                    ParentID = (int?)srcTask.ParentID,
                    Title = srcTask.Title,
                    Start = srcTask.Start,
                    End = srcTask.End,
                    ProjectLink = ((ProgramTask)srcTask).ProjectLink
                };
            }

            protected override IDictionary<string, object> GetSerializationData()
            {
                var dict = base.GetSerializationData();

                dict["ProjectLink"] = ProjectLink;

                return dict;
            }

            public override void LoadFromDictionary(System.Collections.IDictionary values)
            {
                base.LoadFromDictionary(values);

                ProjectLink = (string)values["ProjectLink"];
            }
           

        }

        public class CustomGanttTaskFactory : ITaskFactory
        {
            Task ITaskFactory.CreateTask()
            {
                return new ProgramTask();
            }
        }

        public class GanttProvider : Telerik.Web.UI.GanttProviderBase
        {

            public override ITaskFactory TaskFactory
            {
                get
                {
                    return new CustomGanttTaskFactory();
                }
            }

            public override List<ITask> GetTasks()
            {
                var tasks = new List<ITask>();
                using (SPWeb web = SPContext.Current.Site.OpenWeb())
                {
                    SPList list = web.Lists.TryGetList("Program Roadmap");
                    foreach (SPItem item in list.Items)
                    {
                        tasks.Add(new ProgramTask
                        {
                            ID = item.ID,
                            Title = item["Task Name"].ToString(),
                            Start = Convert.ToDateTime(item["Start Date"]),
                            End = Convert.ToDateTime(item["Due Date"]),
                            PercentComplete = Convert.ToDecimal(item["% Complete"]),
                            ProjectLink = item["ProjectLink"].ToString()

                        });
                    }


                }
                return tasks;
            }

            public override ITask UpdateTask(ITask task)
            {
                ProgramTask my = new ProgramTask();
                return my;

            }

            public override ITask DeleteTask(ITask task)
            {
                ProgramTask my = new ProgramTask();
                return my;
            }

            public override ITask InsertTask(ITask task)
            {
                ProgramTask my = new ProgramTask();
                return my;
            }

            public override List<IDependency> GetDependencies()
            {
                var dependencies = new List<IDependency>();
                return dependencies;
            }

            public override IDependency DeleteDependency(IDependency dependency)
            {
                return dependency;
            }

            public override IDependency InsertDependency(IDependency dependency)
            {

                return dependency;
            }
        }

     

    I'd really appreciated it.

    Dongwook

     

     

  13. 63A53D75-4ABF-4D9F-8CE6-1B9ECA219D8D
    63A53D75-4ABF-4D9F-8CE6-1B9ECA219D8D avatar
    4 posts
    Member since:
    Jun 2017

    Posted 18 Dec 2019 Link to this post

    Dear Telerik,

    How To add 2 custom column ? my second column still undefined

    Which code need modified for add second column ?

    Please help me, I need to finish my project

     

  14. 73AB4FDB-9F60-4E95-94E8-05C89D609656
    73AB4FDB-9F60-4E95-94E8-05C89D609656 avatar
    912 posts
    Member since:
    Apr 2022

    Posted 23 Dec 2019 Link to this post

    Hello Richard,

    There is a KB article showing a simpler example where the needed properties are highlighted and will give you a better idea what is needed to add a new custom column:

    Regards,
    Peter Milchev
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.