Skip to main content

SchedulerStorageControlExtension.Bind(PersistentObjectCancelMethod, PersistentObjectCancelMethod) Method

Allows you to hide specific appointments and resources.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v24.1.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public SchedulerStorageControlExtension Bind(
    PersistentObjectCancelMethod filterAppointmentMethod,
    PersistentObjectCancelMethod filterResourceMethod
)

Parameters

Name Type Description
filterAppointmentMethod PersistentObjectCancelMethod

A FetchAppointmentsMethod delegate providing an appointment data source.

filterResourceMethod PersistentObjectCancelMethod

A PersistentObjectCancelMethod delegate that allows you to hide a specific resource.

Returns

Type Description
SchedulerStorageControlExtension

A SchedulerStorageControlExtension object representing the scheduler storage control.

Remarks

You can specify delegates in the Bind method to hide specific appointments or resources in the scheduler storage control. The delegates are called each time the layout of the Scheduler Storage control is modified (when it is resized, the working area is changed, new appointments are added, or when existing ones are modified, etc.).

The delegate method in turn, is called for each appointment in the Appointments storage. If the PersistentObjectCancelEventArgs.Cancel parameter is set to true for the currently processed appointment, then this appointment will be hidden in the Scheduler Storage control.

The delegate method in turn, is called for each resource in the Resources storage. If the PersistentObjectCancelEventArgs.Cancel parameter is set to true for the currently processed resource, this resource will be hidden in the scheduler. Specifically, the resource will not be displayed when appointments are grouped by resources (see the SchedulerSettings.GroupType topic).

The following code snippet demonstrates how to call the Bind method. Note the correct sequence of calls to different overloads of the SchedulerStorageControlExtension.Bind method. The code hides appointments containing the word “Test” in their subject lines and resources containing the word “TEST” in their captions.

@Html.DevExpress().SchedulerStorageControl(
    settings => {
// Required assignments are done here
// ... 
    }).Bind(
    (e) => {
     if (((Appointment)e.Object).Subject.Contains("Test")) e.Cancel = true; 
    },
    (e) => {
        if (((Resource)e.Object).Caption.Contains("TEST")) e.Cancel = true; 
    }
    ).Bind(Model.Appointments, Model.Resources).GetHtml()
See Also