Show New Resource Data In New Column

2 posts, 0 answers
  1. Nabil
    Nabil avatar
    29 posts
    Member since:
    Dec 2017

    Posted 15 Jan 2018 Link to this post

    hello telerik.

    i'm using telerik gantt chart mvc.

    i have added one more button and dialog box to handle one more ResourceAssignment in my chart control. the 2nd one is all the customized dialog box to show new resource assignments.

    now i'm facing an issue in showing the new ResourceAssignments data in New Column side by the original ResourceAssignment column at treeview side.

    i want to show both resource assignments data in two separate columns. currently both resource's data is showing in the same column that is not what i want.

    i've attached images for clarification

  2. Veselin Tsvetanov
    Veselin Tsvetanov avatar
    1209 posts

    Posted 17 Jan 2018 Link to this post

    Hello Nabil,

    I am afraid, that adding two different resource columns to the Gantt chart is currently not supported by the widget.

    Nevertheless, you could try to workaround this limitation in the following way. Along the resource / assignment information, that you store for each task you could add two custom fields in the Tasks DataSource. Each of these fields will keep a coma separated string holding the names of the Resource Assignments and Cars respectively. Then you could display those two fields instead of the resources column:
    DataSource(d => d
        .Model(m =>
            m.Id(f => f.TaskID);
            m.ParentId(f => f.ParentID);
            m.OrderId(f => f.OrderId);
            m.Field(f => f.Expanded).DefaultValue(true);
            m.Field(f => f.CarsString);
            m.Field(f => f.ResourcesString);
    .Columns(columns =>
        columns.Bound(c => c.TaskID).Title("ID").Width(50);

    Do not forget, that on each update of the Resource / Cars Assignments the respective custom field should also be updated.

    Veselin Tsvetanov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top