DxSchedulerAppointmentMappings Class
Specifies how appointment fields from the data source are mapped to appointment properties in the Scheduler.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.1.dll
NuGet Package: DevExpress.Blazor
Declaration
public class DxSchedulerAppointmentMappings :
DxSchedulerMappingsBase
Related API Members
The following members return DxSchedulerAppointmentMappings objects:
Remarks
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:
- In the Razor
@code
block, use the constructor without parameters to create a DxSchedulerDataStorage object. - Declare a class (for instance,
Appointment
) that stores appointment options. - Create a collection of status source objects (
Appointment
class instances) and define their options. - Assign the newly created collection to the storage’s AppointmentsSource property to fill the storage with a collection of data objects.
- Assign a new
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",
}
};
}
You can also map source object custom fields to a scheduler item’s custom properties. To do this, use the CustomFieldMappings property.