aspnetmvc-devexpress-dot-web-dot-mvc-dot-mvcxganttitemupdatevalues-2.md
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
public abstract class MVCxGanttItemUpdateValues<TItem, TKey> :
MVCxBatchUpdateValues<TItem, TKey>,
IGantBatchValues
where TItem : new()
Public MustInherit Class MVCxGanttItemUpdateValues(Of TItem As New, TKey)
Inherits MVCxBatchUpdateValues(Of TItem, TKey)
Implements IGantBatchValues
| Name | Description |
|---|---|
| TItem |
A type of an object.
| | TKey |
A type of an object key.
|
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));
}
}
Gantt - Data Binding and Modification
Object MVCxBatchUpdateValues<TItem, TKey> MVCxGanttItemUpdateValues<TItem, TKey> MVCxGanttDependencyUpdateValues<TDependency, TKey>
MVCxGanttResourceAssignmentUpdateValues<TAssignment, TKey>
MVCxGanttResourceUpdateValues<TResource, TKey>
MVCxGanttTaskUpdateValues<TTask, TKey>
See Also