To fully appreciate the flexibility of the DXScheduler Suite for WPF, you need to see what's happening inside - how events are represented internally, how they can be transferred to a scheduler from different sources and how they can be exported to external storage mediums. The great news for developers is that we don’t require that you change the manner in which you manage your data - each event is a record within the appropriate data storage container. As such, the data source for the DXScheduler has the same format as data sources for any other data-aware control. Of course, you have alternatives when it comes to data binding. The control's contents can be entirely data-aware (from events to resources) or you can use unbound data and manually manipulate it.
Binding to an External Data Source
In most instances, you will need to store your data in an external data source such as a data table or custom record collection. When necessary, you should bind your scheduler to the required data source using SchedulerStorage – a specific built-in element of the DXScheduler Suite for WPF. SchedulerStorage allows you to specify the datasource and define field mappings so that the scheduler knows which fields to use in order to obtain the start time, end time, event caption, location, etc. You don't necessarily have to define all the mappings exposed by SchedulerStorage. If you don't intend to use all of the functionality offered by the DevExpress Appointments Engine, you need only to specify a set of required fields (the Start and the End fields are mandatory).
You can define any number of custom fields and map them to the appointment's custom properties. The data obtained from custom fields can be used to change appointment information displayed in the Scheduler View. Custom fields can be exposed to end-users via custom appointment editing forms.
To provide multi-resource display, you should bind one more record collection to the SchedulerStorage. Each record in this collection will represent a resource with its caption, color and ID - which is used to bind events and resources.
If you do not bind a data source to the SchedulerStorage, it will maintain events and resources in its internal storage system. Thus, you can simply drop the SchedulerControl onto a form and instantly get a fully functioning calendar.
Unbound mode is a quick and easy way to get started with the Scheduler control and explore its many capabilities or when you need to manually control/manage data. Keep in mind the following tips when using the DXScheduler Suite for WPF in Unbound mode:
- All fields required for event functionality are automatically created and maintained.
- The data entered into the scheduler can be saved to a file and restored at a later time.
- You can combine data-aware and unbound mode. For instance, you can store events in an external data table but use unbound mode for resources.
Binding Custom Fields to an Appointment
The default data fields used for appointment management are not a limit to the data an appointment can hold. You can additionally specify any number of fields you need via the storage's AppointmentStorage.CustomFieldMappings property. If you specify custom fields, you can allow your end users to modify field values via custom dialogs, or initialize these fields in code. With this approach you don't have to create any additional data storage to maintain extended data for individual events.
Learn More: Examples: Binding To Data Sources | Help Topic: Bind a Scheduler to Data