Skip to main content

MVCxGanttResourceUpdateValues<TResource, TKey> Class

Contains information about updated resources.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v24.1.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public class MVCxGanttResourceUpdateValues<TResource, TKey> :
    MVCxGanttItemUpdateValues<TResource, TKey>
    where TResource : new()

Type Parameters

Name Description
TResource

A type of a resource.

TKey

A type of a resource key.

Remarks

The following example illustrates how to use the MVCxGanttResourceUpdateValues 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){

    ProcessResourceValues(resourceUpdateValues);
    //...
}

void ProcessResourceValues(MVCxGanttResourceUpdateValues<Resource, string> resourceUpdateValues) {
    foreach(var item in resourceUpdateValues.Update)
        GanttDataProvider.UpdateResource(item);
    foreach(var itemKey in resourceUpdateValues.DeleteKeys)
        GanttDataProvider.DeleteResource(itemKey);
    foreach(var item in resourceUpdateValues.Insert) {
        resourceUpdateValues.MapInsertedItemKey(item, GanttDataProvider.InsertResource(item));
    }
}

Online Demo

Gantt - Data Binding and Modification

Inheritance

Object
MVCxBatchUpdateValues<TResource, TKey>
MVCxGanttItemUpdateValues<TResource, TKey>
MVCxGanttResourceUpdateValues<TResource, TKey>
See Also