Skip to main content
A newer version of this page is available.
All docs
V18.2

How to: Set Mappings

  • 2 minutes to read

How to Set Mappings at Design Time

At design time, you can run a Mappings Wizard to establish mappings for appointments and resources. Wizards can generate mappings automatically using the algorithm based on the field name and type. However, you are advised to check autogenerated mappings to ensure that they are correct, because incorrect mappings may result in obscure errors that are difficult to trace.

The Mappings Wizard for appointments is shown in the following image:

Mappings-Wizards-Appointments-01

How to Set Mappings in Code

Provide field mappings in code using the AppointmentStorageBase.Mappings and ResourceStorage.Mappings properties. Specify the AppointmentDependencyStorage.Mappings if you plan to use the Gantt View.

You can define any number of custom fields for your specific purpose, and map them to the custom properties via the AppointmentStorage.CustomFieldMappings, ResourceStorage.CustomFieldMappings and AppointmentDependencyStorage.CustomFieldMappings properties.

The following code snippet maps the data source containing the “AllDay”, “EventDescription”, “EndDate”, “Label”, “Location”, “RecurrenceInformation”, “Reminder”, “StartDate”, “Status”, “Subject”, “AppointmentType”, “ResourceIDs” and “CustomField1” fields to the corresponding properties and custom fields of the appointment.


private void MapAppointmentData()
{
    this.schedulerDataStorage1.Appointments.Mappings.AllDay = "AllDay";
    this.schedulerDataStorage1.Appointments.Mappings.Description = "EventDescription";
    // Required mapping.
    this.schedulerDataStorage1.Appointments.Mappings.End = "EndDate";
    this.schedulerDataStorage1.Appointments.Mappings.Label = "Label";
    this.schedulerDataStorage1.Appointments.Mappings.Location = "Location";
    this.schedulerDataStorage1.Appointments.Mappings.RecurrenceInfo = "RecurrenceInformation";
    this.schedulerDataStorage1.Appointments.Mappings.ReminderInfo = "Reminder";
    // Required mapping.
    this.schedulerDataStorage1.Appointments.Mappings.Start = "StartDate";
    this.schedulerDataStorage1.Appointments.Mappings.Status = "Status";
    this.schedulerDataStorage1.Appointments.Mappings.Subject = "Subject";
    this.schedulerDataStorage1.Appointments.Mappings.Type = "AppointmentType";
    this.schedulerDataStorage1.Appointments.Mappings.ResourceId = "ResourceIDs";
    this.schedulerDataStorage1.Appointments.CustomFieldMappings.Add(new AppointmentCustomFieldMapping("MyNote", "CustomField1")); 
}

private void MapResourceData()
{
    this.schedulerDataStorage1.Resources.Mappings.Id = "ResourceID";
    this.schedulerDataStorage1.Resources.Mappings.Caption = "ResourceName";
}