DxSchedulerAppointmentStatusMappings Class
Specifies how status fields from the data source are mapped to appointment properties in the Scheduler.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
public class DxSchedulerAppointmentStatusMappings :
DxSchedulerMappingsBase
Related API Members
The following members return DxSchedulerAppointmentStatusMappings objects:
Remarks
The appointment displays its status as a colored strip on the left edge that indicates the availability state. The Scheduler has a built-in collection of status values:
You can use the DxSchedulerAppointmentStatusMappings
class to create a collection of your own status values:
- Create a DxSchedulerDataStorage object that uses a constructor without parameters and specify appointment mappings. See the DxSchedulerAppointmentMappings class description for more information.
- Declare a class (for instance,
StatusObject
) that stores status options and an ID. - Create a collection of status source objects (
StatusObject
class instances) and define their options. - Assign the newly created collection to the storage’s AppointmentStatusSource property.
- Assign the
DxSchedulerAppointmentStatusMappings
object to the AppointmentStatusMappings property. In this object, map the status item’s source fields to the status item’s properties. - Optional. You can create custom fields for status items. Define custom fields in the status item’s source object and add these fields to the CustomFieldMappings collection. For instance, the following code snippet adds the
MyCustomField
field to theStatusObject
and maps this field to the status item’sMyCustomProperty
.
<DxScheduler StartDate="@DateTime.Today"
DataStorage="@DataStorage">
<DxSchedulerWeekView ShowWorkTimeOnly="true"></DxSchedulerWeekView>
</DxScheduler>
@code {
DxSchedulerDataStorage DataStorage = new DxSchedulerDataStorage() {
// Specify appointment mappings here.
// ...
AppointmentStatusSource = StatusCollection.GetStatuses(),
AppointmentStatusMappings = new DxSchedulerAppointmentStatusMappings() {
Id = "Id",
Caption = "StatusCaption",
Color = "StatusColor",
// Uncomment the line below and comment the line above to specify other style options.
//CssClass = "CssClass",
// Map the source object's custom field to the status item's custom property.
CustomFieldMappings = new List<DxSchedulerCustomFieldMapping> {
new DxSchedulerCustomFieldMapping { Name = "MyCustomProperty", Mapping = "MyCustomField" }
}
}
};
}
Note
When you use templates to customize appointment appearance, the Color and CssClass property values are not applied to appointments. In the template, you can use the context.Status
parameter to access these property values.