Skip to main content

Data Binding

  • 4 minutes to read

Most DevExpress data-aware controls are compatible with any data access technology (ADO.NET, Entity Framework, XPO, etc.) and capable to display data from any data source that implements the IList, IBindingList, or ITypedList interface. Refer to these help topics for more details: Traditional Data Binding Methods and Data Binding Common Concepts.

You can retrieve Scheduler appointments (including their reminders, statuses and labels) and resources from data sources. The Scheduler uses the SchedulerDataStorage component to load data. Use the smart tag menu to assign sources.



Appointments, resources, labels, and other elements have required and optional data-bound properties. For instance, appointment start and end dates, ID, and type are required properties, whereas time zone ID, status, subject, reminder, etc. are optional. The Mappings section enumerates all bindable properties and explains which are required.

Use the Mappings Wizard to set up mappings at design time.


You can also set object mappings in code.

private void MapAppointmentData()
    //required mappings
    schedulerDataStorage1.Appointments.Mappings.End = "EndDate";
    schedulerDataStorage1.Appointments.Mappings.Start = "StartDate";
    //optional mappings
    schedulerDataStorage1.Appointments.Mappings.AllDay = "AllDay";
    //. . .
    schedulerDataStorage1.Appointments.Mappings.ResourceId = "ResourceIDs";
    //custom fields
        new AppointmentCustomFieldMapping("MyNote", "CustomField1")); 

Import Holidays from a Data Source

To import holidays, parse loaded data and populate the WorkDaysCollection with Holiday objects. See the “Holidays” Demo module for an example.


Holiday cells have a different appearance than regular day cells but do not impose any user restrictions. If you want to block specific dates, create all-day TimeRegion objects.

Sample Data Sources

If you do not have a ready-to-use data source populated with data, you can generate a new source. Documents in the Data Sources section contain sample data sources of different types (SQL Server, Entity Framework, XML, etc.) you can use as references.

Unbound mode

Whether your Scheduler is bound to a data source or not, you can add new elements (appointments, resources, etc.) directly from code. To do that, call the SchedulerDataStorage‘s Create… methods.

The code below adds a new status, a new label, and a new appointment that has this new status and label. The appointment lasts for 15 minutes, repeats five times, and occurs on every second day. Note that “Create…” methods initialize new objects, but do not add them to a storage; this is why you have to additionally call the Add method.

Appointment apt = schedulerDataStorage1.CreateAppointment(
    "Appointment Created in Code");
apt.Location = "My Location";
apt.Description = "My Description";
apt.RecurrenceInfo.Type = RecurrenceType.Daily;
apt.RecurrenceInfo.Periodicity = 2;
apt.RecurrenceInfo.Start = apt.Start;
apt.RecurrenceInfo.Range = RecurrenceRange.OccurrenceCount;
apt.RecurrenceInfo.OccurrenceCount = 5;

var lbl = schedulerDataStorage1.Appointments.Labels.CreateNewLabel("vi","Very Important");

var status = schedulerDataStorage1.Appointments.Statuses.CreateNewStatus("vb", "Very Busy");
status.SetBrush(new HatchBrush(HatchStyle.ForwardDiagonal, Color.IndianRed, Color.White));

apt.StatusKey = "vb";
apt.LabelKey = "vi";

How to Refresh Data

The Scheduler Control (or any other DevExpress data-aware control) is not connected to a database directly, and uses a data source layer instead. For this reason, the control does not automatically reflect database changes. You need to track these changes and call the SchedulerDataStorage.RefreshData() method. You can also use the standard Timer component to repeatedly refresh Scheduler data.

private void timer1_Tick(object sender, EventArgs e) {
    if (schedulerControl1.Services.SchedulerState.IsDataRefreshAllowed) {

The RefreshData method triggers the SchedulerDataStorage.FetchAppointments event. Handle this event to load data in portions. See this example for more information: How to: Use the FetchAppointments Event for Faster Appointment Loading.