Back to Devexpress

MVCxGanttItemUpdateValues<TItem, TKey> Class

aspnetmvc-devexpress-dot-web-dot-mvc-dot-mvcxganttitemupdatevalues-2.md

latest3.3 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Web.Mvc5

Declaration

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

Type Parameters

NameDescription
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:

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

Controller Code:

csharp
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

Inheritance

Object MVCxBatchUpdateValues<TItem, TKey> MVCxGanttItemUpdateValues<TItem, TKey> MVCxGanttDependencyUpdateValues<TDependency, TKey>

MVCxGanttResourceAssignmentUpdateValues<TAssignment, TKey>

MVCxGanttResourceUpdateValues<TResource, TKey>

MVCxGanttTaskUpdateValues<TTask, TKey>

See Also

MVCxGanttItemUpdateValues<TItem, TKey> Members

DevExpress.Web.Mvc Namespace