New to Telerik UI for ASP.NET MVC? Download free 30-day trial

GanttAssignmentsSettingsBuilder

Methods

DataSource(System.Action)

The data source which contains assignment data items. Can be a JavaScript object which represents a valid data source configuration, a JavaScript array or an existing kendo.data.DataSource instance.If the dataSource option is set to a JavaScript object or array, the component will initialize a new kendo.data.DataSource instance using that value as data source configuration.If the dataSource option is an existing kendo.data.DataSource instance the component will use that instance and will not initialize a new one.

Parameters

configurator - System.Action<GanttAssignmentsDataSourceBuilder>

The value that configures the datasource.

Example


            @(Html.Kendo().Gantt<TaskViewModel, DependencyViewModel>()
                .Name("gantt")
                .Assignments<ResourceAssignmentViewModel>(a => a
                    .DataTaskIdField("TaskID")
                    .DataResourceIdField("ResourceID")
                    .DataValueField("Units")
                    .DataSource(d => d
                        .Model(m =>
                        {
                        m.Id(f => f.ID);
                    })
                        .Read("Read_Assignments", "Gantt")
                        .Create("Create_Assignment", "Gantt")
                        .Destroy("Destroy_Assignment", "Gantt")
                        .Update("Update_Assignment", "Gantt")
                    )
                )
            )

DataResourceIdField(System.String)

The field of the assignment data item which represents the resource id.

Parameters

value - System.String

The value that configures the dataresourceidfield.

Example


            @(Html.Kendo().Gantt<TaskViewModel, DependencyViewModel>()
                .Name("gantt")
                .Assignments<ResourceAssignmentViewModel>(a => a
                    .DataResourceIdField("ResourceID")
                )
            )

DataTaskIdField(System.String)

The field of the assignment data item which represents the task id.

Parameters

value - System.String

The value that configures the datataskidfield.

Example


            @(Html.Kendo().Gantt<TaskViewModel, DependencyViewModel>()
                .Name("gantt")
                .Assignments<ResourceAssignmentViewModel>(a => a
                    .DataTaskIdField("TaskID")
                )
            )

DataValueField(System.String)

The field of the assignment data item which represents the amount of the assigned resource.

Parameters

value - System.String

The value that configures the datavaluefield.

Example


            @(Html.Kendo().Gantt<TaskViewModel, DependencyViewModel>()
                .Name("gantt")
                .Assignments<ResourceAssignmentViewModel>(a => a
                    .DataValueField("Units")
                )
            )

BindTo(System.Collections.IEnumerable)

Binds the gantt assignments to a list of objects

Parameters

dataSource - System.Collections.IEnumerable

The dataSource

Example


            @(Html.Kendo().Gantt<TaskViewModel, DependencyViewModel>()
                .Name("gantt")
                .Assignments<ResourceAssignmentViewModel>(a => a
                    .BindTo(EnumerableCollection)
                )
            )

In this article
Not finding the help you need?