Gantt Custom Columns

12 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1687 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. Shakti SIngh Dulawat
    Shakti SIngh Dulawat 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. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    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
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  4. Rajshree
    Rajshree avatar
    28 posts
    Member since:
    Feb 2015

    Posted 26 Feb 2015 in reply to Hristo Valyavicharski 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. Rajshree
    Rajshree avatar
    28 posts
    Member since:
    Feb 2015

    Posted 26 Feb 2015 in reply to Hristo Valyavicharski 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. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    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. Dwayne
    Dwayne avatar
    2 posts
    Member since:
    Sep 2013

    Posted 22 Apr 2015 in reply to Telerik Admin 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. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    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. Dan
    Dan 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. jailani
    jailani  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. محمد
    محمد avatar
    1 posts
    Member since:
    Nov 2016

    Posted 24 Nov 2016 in reply to Telerik Admin 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. Dongwook Kim
    Dongwook Kim avatar
    3 posts
    Member since:
    Nov 2009

    Posted 4 days and 20 hours ago 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

     

     

Back to Top