Back to Devexpress

SchedulerDataStorage.DataSource Property

maui-devexpress-dot-maui-dot-scheduler-dot-schedulerdatastorage-c23d9135.md

latest3.5 KB
Original Source

SchedulerDataStorage.DataSource Property

Gets or sets the data source for the scheduler.

Namespace : DevExpress.Maui.Scheduler

Assembly : DevExpress.Maui.Scheduler.dll

NuGet Package : DevExpress.Maui.Scheduler

Declaration

csharp
public DataSource DataSource { get; set; }

Property Value

TypeDescription
DataSource

An object that provides data for the scheduler.

|

Remarks

The DataSource property allows you to bind a scheduler view to an external data source. Use the DataSource.AppointmentsSource, DataSource.AppointmentLabelsSource and DataSource.AppointmentStatusesSource properties to provide data sources for the scheduler’s appointments, labels and statuses.

Appointment Mappings

When you bind the scheduler to a data source, you need to map appointment, label, and status properties to data source fields. The names of the database fields are usually fixed and you cannot change them. Mappings are used to adjust the scheduler’s data model to the existing data model.

Use the DataSource object’s AppointmentMappings, AppointmentLabelMappings and AppointmentStatusMappings properties to define which data source fields should serve as sources of data for properties of the scheduler’s appointment, label and status.

Unbound Mode

A scheduler view can operate in unbound mode. If you do not bind a data source to the scheduler, it maintains appointments, labels, and statuses internally. To manage scheduler items in code, use the following collections:

In this mode, scheduler does not save changes that you made to its data when the application is unloaded. You must save this information and load it when an application is loaded.

Example

This example shows how to bind a DayView instance to a data source that stores custom appointment ( MedicalAppointment ) and label ( MedicalAppointmentType ) objects.

  1. Assign a view model object to the content page’s BindingContext property.
  2. Set the DayView.DataStorage property to a SchedulerDataStorage object.
  3. Set the SchedulerDataStorage.DataSource property to a DataSource object and specify the following properties of this object:

See Also

SchedulerDataStorage Class

SchedulerDataStorage Members

DevExpress.Maui.Scheduler Namespace