Skip to main content

DxSchedulerAppointmentStatusItem Class

An appointment’s availability status.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public class DxSchedulerAppointmentStatusItem :
    DxSchedulerSourceObjectContainer

Remarks

You can associate a status with an appointment to indicate its availability. The appointment displays its status as a colored strip on the left edge.

Scheduler Appointment

When users create or edit an appointment in the Appointment form, they can select the appointment’s status from the drop-down Status list.

Scheduler - Default appointment statuses

The Caption property specifies the status item’s text. The Color or CssClass property defines the status item’s appearance.

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.

Built-In Status Values

The Scheduler has a built-in collection of status values:

  • Free (ID: 0)
  • Working elsewhere (ID: 1)
  • Tentative (ID: 2)
  • Busy (ID: 3)
  • Away (ID: 4)

Custom Status Values

Do the following to substitute the built-in collection of status values with your own values:

  1. Create a DxSchedulerDataStorage object that uses a constructor without parameters and specify appointment mappings. See the DxSchedulerAppointmentMappings class description for more information.
  2. Declare a class (for instance, StatusObject) that stores status options and an ID.
  3. Create a collection of status source objects (StatusObject class instances) and define their options.
  4. Assign the newly created collection to the storage’s AppointmentStatusSource property.
  5. Assign the DxSchedulerAppointmentStatusMappings object to the AppointmentStatusMappings property. In this object, map the status item’s source fields to the status item’s properties.
  6. 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 the StatusObject and maps this field to the status item’s MyCustomProperty.
<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" }
            }
        }
    };
}

Scheduler Appointment Custom Status

Inheritance

Object
DevExpress.Blazor.Scheduler.Internal.NotifyPropertyChangedBase
DxSchedulerSourceObjectContainer
DxSchedulerAppointmentStatusItem
See Also