Skip to main content

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
)

Parameters

Name Type Description
dataObject Object

A collection of Scheduler appointments.

Returns

Type Description
T

A reference to this instance after the operation is completed.

Remarks

IMPORTANT

Bootstrap Controls for ASP.NET Core are in maintenance mode. We don’t add new controls or develop new functionality for this product line. Our recommendation is to use the ASP.NET Core Controls suite.

$1 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