MVCxGanttResourceAssignmentUpdateValues<TAssignment, TKey> Class

Contains information about updated resource assignments.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v20.2.dll

Declaration

public class MVCxGanttResourceAssignmentUpdateValues<TAssignment, TKey> :
    MVCxGanttItemUpdateValues<TAssignment, TKey>
    where TAssignment : new()
Public Class MVCxGanttResourceAssignmentUpdateValues(Of TAssignment As New, TKey)
    Inherits MVCxGanttItemUpdateValues(Of TAssignment, TKey)

Type Parameters

Name Description
TAssignment

A type of a resource assignment.

TKey

A type of a resource assignment key.

Remarks

The following example illustrates how to use the MVCxGanttResourceAssignmentUpdateValues object. Refer to the online demo to get the full code.

Partial View:

@Html.DevExpress().Gantt(settings => {
    settings.BatchUpdateRouteValues = new { Controller = "Features", Action = "GanttBatchUpdate" };
    // ...
}).Bind(
    GanttDataProvider.Tasks, 
    GanttDataProvider.Dependencies, 
    GanttDataProvider.Resources, 
    GanttDataProvider.ResourceAssignments
).GetHtml()

Controller Code:

public ActionResult GanttBatchUpdate(
    MVCxGanttTaskUpdateValues<Task, string> taskUpdateValues,
    MVCxGanttDependencyUpdateValues<Dependency, string> dependencyUpdateValues
    MVCxGanttResourceUpdateValues<Resource, string> resourceUpdateValues,
    MVCxGanttResourceAssignmentUpdateValues<ResourceAssignment, string> resourceAssignmentUpdateValues){

    ProcessResourceAssignmentValues(resourceAssignmentUpdateValues);
    //...
}

void ProcessResourceAssignmentValues(
  MVCxGanttResourceAssignmentUpdateValues<ResourceAssignment, string> resourceAssignmentUpdateValues) {
    foreach(var itemKey in resourceAssignmentUpdateValues.DeleteKeys)
        GanttDataProvider.DeleteResourceAssignment(itemKey);
    foreach(var item in resourceAssignmentUpdateValues.Insert) {
        resourceAssignmentUpdateValues.MapInsertedItemKey(item, GanttDataProvider.InsertResourceAssignment(item));
    }
}

Online Demo

Gantt - Data Binding and Modification

Inheritance

Object
MVCxBatchUpdateValues<TAssignment, TKey>
MVCxGanttItemUpdateValues<TAssignment, TKey>
MVCxGanttResourceAssignmentUpdateValues<TAssignment, TKey>
See Also