BootstrapSchedulerBuilderBase<T>.BindAppointments(Object) Method

Binds the Scheduler's appointments to the specified appointment collection.

Namespace: DevExpress.AspNetCore.Bootstrap

Assembly: DevExpress.AspNetCore.Bootstrap.v18.2.dll

Declaration

public T BindAppointments(
    object dataObject
)
Public Function BindAppointments(
    dataObject As Object
) As T

Parameters

Type Name Description
Object dataObject

A collection of Scheduler appointments.

Returns

Type Description
T

A reference to this instance after the operation is completed.

Remarks

Pass a collection of appointment data objects to the BindAppointments method to display appointments within the Scheduler.

@model IEnumerable<ToDoTask>
@(Html.DevExpress()
    .BootstrapScheduler<ToDoTask>("scheduler1")
    .Start(new DateTime(2018, 05, 21))
    .Storage(storage => storage
        .Appointments(appointments => appointments
            .Mappings(map => map
                .AppointmentId(a => a.Id)
                .Subject(a => a.Text)
                .Start(a => a.StartDate)
                .End(a => a.EndDate))))
    .BindAppointments(Model)
    .Routes(routes => routes
        .MapRoute(r => r
            .Controller("Scheduler")
            .Action("DataBinding"))))

Note that to be able to obtain and save appointments to/from the data storage, you also need to specify at least the following mandatory data field mappings:

You also need to define a separate route to process appointment editing:

@model IEnumerable<ToDoTask>
@(Html.DevExpress()
    .BootstrapScheduler<ToDoTask>("scheduler1")
    ...
    .Routes(routes => routes
        .MapRoute(r => r
            .Controller("Scheduler")
            .Action("DataBinding"))
        .MapRoute(r => r
            .RouteType(SchedulerRouteType.EditAppointment)
            .Controller("Scheduler")
            .Action("ProcessAppointmentsChanges"))))
See Also