This is a migrated thread and some comments may be shown as answers.

Show New Resource Data In New Column

1 Answer 55 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Nabil
Top achievements
Rank 1
Nabil asked on 15 Jan 2018, 07:06 AM

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

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 17 Jan 2018, 08:00 AM
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);
    columns.Bound("title").Editable(true);
    columns.Bound("start").Editable(true);
    columns.Bound("end").Editable(true);
    columns.Bound("CarsString").Title("Cars").Editable(false);
    columns.Bound("ResourcesString").Title("Resources").Editable(false);
})

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

Regards,
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.
Tags
Gantt
Asked by
Nabil
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or