adding new columns with custom data to resource view

In Gantt chart resource view, I can add upto four columns namely Id, name, unit and group. Is there any way I can add custom columns here? In Microsoft Project, they provide built in "Resource Sheet" view and under the resource tab of each task, you can pick any item from resource sheet (added to mpp file) and assign it to task. For each, selected item of resource sheet, you can input unit and cost as well. This helps in getting the work measurement done and based on that actual progress on the task can be measured. (Pls check the video attached herewith).

Is there any possibility that I can transform Resources tab in your Gantt chart control to something like resource sheet view of Microsoft project? If not, what are your thoughts on how to link the data from resource sheet to gantt chart individual tasks?

Attachment: Resources_2543f897.zip

1 Reply 1 reply marked as answer

MS Monisha Sivanthilingam Syncfusion Team May 25, 2021 09:48 AM UTC

Hi Krunal, 
 
Greetings from Syncfusion support. 
 
We can achieve your requirement of adding a custom column in the resources tab by making use of the beforeOpenAddDialog and beforeOpenEditDialog request types in the actionBegin event. We have pushed the custom column to the column collection in the resources tab when the actionBegin event is fired. The following code snippets demonstrate the solution. 
 
HomeConttoller.cs 
 
ResourceGroupCollection Record1 = new ResourceGroupCollection() 
{ 
   ResourceId = 1, 
   ResourceName = "Martin Tamer", 
   Cost = 500 
}; 
 
 
 
public class ResourceGroupCollection 
{ 
   public int ResourceId { get; set; } 
   public string ResourceName { get; set; } 
   public int Cost { get; set; } 
} 
 
 
Index.cshtml 
 
<script> 
    function actionBegin(args) { 
        if (args.requestType == "beforeOpenEditDialog" || args.requestType == "beforeOpenAddDialog") { 
            args.Resources.columns.push("Cost"); 
        } 
    } 
</script> 
 
 
We have also prepared a sample for your reference. 
 
Please contact us if you require any further assistance. 
 
Regards, 
Monisha. 


Marked as answer
Loader.
Up arrow icon