SchedulerExtension.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 SchedulerExtension Bind(
PersistentObjectCancelMethod filterAppointmentMethod,
PersistentObjectCancelMethod filterResourceMethod
)
Parameters
Name | Type | Description |
---|---|---|
filterAppointmentMethod | PersistentObjectCancelMethod | A PersistentObjectCancelMethod delegate that allows you to hide a specific appointment. |
filterResourceMethod | PersistentObjectCancelMethod | A PersistentObjectCancelMethod delegate that allows you to hide a specific resource. |
Returns
Type | Description |
---|---|
SchedulerExtension | A SchedulerExtension object representing the scheduler. |
Remarks
You can specify delegates in the Bind method to hide specific appointments or resources in the scheduler. The delegates are called each time the layout of the ASPxScheduler control is modified (when the control is resized, when the working area is changed, when new appointments are added, or 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 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 SchedulerExtension.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().Scheduler(
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()