All docs
V19.2
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

MVCxGanttItemUpdateValues<TItem, TKey> Class

Serves as a base class for classes that contain information about updated objects.

Namespace: DevExpress.Web.Mvc

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

Declaration

public abstract class MVCxGanttItemUpdateValues<TItem, TKey> :
        MVCxBatchUpdateValues<TItem, TKey>
    where TItem : new()
Public MustInherit Class MVCxGanttItemUpdateValues(Of TItem As New, TKey)
    Inherits MVCxBatchUpdateValues(Of TItem, TKey)

Type Parameters

Name Description
TItem

A type of an object.

TKey

A type of an object key.

Remarks

The following example illustrates how to use the MVCxGanttTaskUpdateValues object that is a descendant of the MVCxGanttItemUpdateValues base class. 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){
    ProcessTaskValues(taskUpdateValues);
    return GanttExtension.GetBatchUpdateResult(taskUpdateValues, dependencyUpdateValues);
}

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

See Also