DxSchedulerDataStorage Class

A storage that holds data for the Scheduler control.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.dll

Declaration

public class DxSchedulerDataStorage

Remarks

The DxSchedulerDataStorage object is an essential element required for the DxScheduler component operation. It contains source data for the following Scheduler persistent objects:

  • appointments;
  • labels;
  • statuses.

The DxSchedulerDataStorage defines property mappings that map data fields to persistent object properties.

The DxSchedulerDataStorage provides API to retrieve persistent objects and manage them.

The <DxScheduler> component is bound to the DxSchedulerDataStorage instance with the DxScheduler.DataStorage property.

Create Data Storage and Specify Mappings

Follow the steps below:

Note

The DxSchedulerDataStorage object contains built-in label and status collection. The scheduler uses built-in collections when label and status sources and mappings are not specified.

The following code snippet demonstrates how to create the DxSchedulerDataStorage object, specify mappings and assign the storage to the <DxScheduler> component.

<DxScheduler DataStorage="@DataStorage">
  <DxSchedulerDayView> 
  </DxSchedulerDayView>
</DxScheduler> 

Retrieve Persistent Objects

The DxSchedulerDataStorage object provides you with methods to retrieve all kinds of persistent objects from the storage. The methods are listed in the table below.

Method Description
GetAppointmentItemById Returns an appointment with the specified identifier from the storage.
GetAppointments Returns appointments within the specified date-time range.
GetExceptions Returns all exceptions to the specified pattern.
GetOccurrenceOrException Returns an occurrence or exception with the specified recurrence index from the recurring series specified by its pattern.
GetOccurrencesAndExceptions
GetPattern Returns a pattern of the specified occurrence or exception.
GetLabelItemById Returns a label with the specified identifier from the storage.
GetStatusItemById Returns a status with the specified identifier from the storage.

Manage Persistent Objects

The DxSchedulerDataStorage object provides you with methods that create a persistent object. In contrast with a simple object constructor, these methods create two objects - a persistent object along with a related source object - and establish mapping between them.

Method Description
CreateAppointmentItem Creates a new appointment item.
CreateLabelItem Creates a new label item.
CreateStatusItem Creates a new label item.

Label and Status collections rarely change compared with the Appointment collection. This is the reason for the RemoveAppointment method - a method that you should use to remove an appointment from the scheduler.

Inheritance

Object
DxSchedulerDataStorage
See Also