blazor-devexpress-dot-blazor-aa1aa6a2.md
Specifies how appointment fields from the data source are mapped to appointment properties in the Scheduler.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
public class DxSchedulerAppointmentMappings :
DxSchedulerMappingsBase
The following members return DxSchedulerAppointmentMappings objects:
The Scheduler works with the DxSchedulerDataStorage object that contains source data for the following Scheduler persistent objects:
The DxSchedulerDataStorage defines property mappings that map data fields to persistent object properties. This class also includes API to retrieve persistent objects and to manage them.
The DxSchedulerAppointmentMappings object allows you to incorporate information on appointment items into the Scheduler. Follow the steps below to do this:
@code block, use the constructor without parameters to create a DxSchedulerDataStorage object.Appointment) that stores appointment options.Appointment class instances) and define their options.DxSchedulerAppointmentMappings object to the DxSchedulerDataStorage.AppointmentMappings property. In this object, map the data source fields to appointment properties.<DxScheduler StartDate="@DateTime.Today" DataStorage="@DataStorage">
<DxSchedulerWeekView ShowWorkTimeOnly="true"></DxSchedulerWeekView>
</DxScheduler>
@code {
DxSchedulerDataStorage DataStorage = new DxSchedulerDataStorage() {
AppointmentsSource = AppointmentCollection.GetAppointments(),
AppointmentMappings = new DxSchedulerAppointmentMappings() {
Start = "StartDate",
End = "EndDate",
Subject = "Caption",
LabelId = "Label",
StatusId = "Status",
}
};
}
public class Appointment {
public Appointment() {}
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public string Caption { get; set; }
public int Label { get; set; }
public int Status { get; set; }
}
public static partial class AppointmentCollection {
public static List<Appointment> GetAppointments() {
DateTime date = DateTime.Today;
var dataSource = new List<Appointment>() {
new Appointment {
Caption = "Install New Router in Dev Room",
StartDate = date + (new TimeSpan(0, 10, 0, 0)),
EndDate = date + (new TimeSpan(0, 12, 0, 0)),
Label = 6,
Status = 1
},
new Appointment {
Caption = "Upgrade Personal Computers",
StartDate = date + (new TimeSpan(0, 13, 0, 0)),
EndDate = date + (new TimeSpan(0, 14, 30, 0)),
Label = 1,
Status = 1
},
new Appointment {
Caption = "Website Redesign Plan",
StartDate = date + (new TimeSpan(1, 9, 30, 0)),
EndDate = date + (new TimeSpan(1, 11, 30, 0)),
Label = 1,
Status = 1
},
// ...
};
return dataSource;
}
}
You can also map source object custom fields to a scheduler item’s custom properties. To do this, use the CustomFieldMappings property.
Run Demo: Scheduler - View Types
Run Demo: Scheduler - Recurring Appointments
Object DevExpress.Blazor.Scheduler.Internal.BindableBase DxSchedulerMappingsBase DxSchedulerAppointmentMappings
See Also