Problem:
How can I bind the XtraScheduler to eXpress Persistent Objects, if an Apppointment Storage contains multi-resource appointments (the AppointmentStorage.ResourceSharing property is set to true). I've already read KB aritcle #A2787 (How to bind the XtraScheduler to XPO), but it doesn't help much.
Solution:
To accomplish this task, perform the following steps:
1. Add the DevExpress.Xpo.vX.y.dll assembly to the references list of the project.
2. Declare XPAppointment and XPResource classes (derived from XPObject).
3. Rebuild the application, so that these objects can be used for the XPCollection.
4. Drop two XPCollection components from the toolbox onto a Form and name them xpCollectionAppointments and xpCollectionResources.
5. Set their ObjectClassInfo properties to the XPAppointment and XPResource objects, respectively.
6. Set the SchedulerStorage.Appointments.DataSource property to xpCollectionAppointments, and the SchedulerStorage.Resources.DataSource property to xpCollectionResources.
7. Specify all required mappings for the AppointmentStorage and the ResourceStorage.
8. Handle the SchedulerStorage.AppointmentsChanged and SchedulerStorage.AppointmentsInserted events using the event handler which calls the XPBaseObject.Save method. The event handler is the same for both events.
This approach is illustrated by the sample project.