Skip to main content

MVCxGanttTaskUpdateValues<TTask, TKey> Class

Contains information about updated tasks.

Namespace: DevExpress.Web.Mvc

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

NuGet Package: DevExpress.Web.Mvc5

Declaration

public class MVCxGanttTaskUpdateValues<TTask, TKey> :
    MVCxGanttItemUpdateValues<TTask, TKey>
    where TTask : new()

Type Parameters

Name Description
TTask

A type of a task.

TKey

A type of a task key.

Remarks

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

    ProcessTaskValues(taskUpdateValues);
    //...
}

void ProcessTaskValues(MVCxGanttTaskUpdateValues<Task, string> taskUpdateValues) {
    foreach(var item in taskUpdateValues.Update)
        GanttDataProvider.UpdateTask(item);
    foreach(var itemKey in taskUpdateValues.DeleteKeys)
        GanttDataProvider.DeleteTask(itemKey);
    foreach(var item in taskUpdateValues.Insert) {
        taskUpdateValues.MapInsertedItemKey(item, GanttDataProvider.InsertTask(item));
    }
}

Online Demo

Gantt - Data Binding and Modification

Inheritance

Object
MVCxBatchUpdateValues<TTask, TKey>
MVCxGanttItemUpdateValues<TTask, TKey>
MVCxGanttTaskUpdateValues<TTask, TKey>
See Also