Skip to main content

DxSchedulerDataStorage.AppointmentMappings Property

Specifies how the appointment properties are mapped to the data source fields.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public DxSchedulerAppointmentMappings AppointmentMappings { get; set; }

Property Value

Type Description
DxSchedulerAppointmentMappings

Stores information on how appointment properties are mapped to data fields.

Remarks

The appointment data source and its mappings are mandatory for proper DxSchedulerDataStorage operation. You should specify the AppointmentMappings and the AppointmentsSource properties. The Start and End properties are also required to render appointments correctly. You can omit other mappings. Note that if you do not map properties, changes made in the UI are not saved in the data source fields as the Scheduler component cannot automatically determine where to store these changes.

The example below shows how to create mappings:

@code {
    DxSchedulerDataStorage DataStorage = new DxSchedulerDataStorage() {
        AppointmentsSource = new Lazy<List<Appointment>>(InitAppointments),
        AppointmentMappings = new DxSchedulerAppointmentMappings() {
            Id = "AppointmentId",
            Start = "StartDate",
            End = "EndDate",
            Subject = "Caption",
            AllDay = "AllDay",
            Location = "Location",
            Description = "Description",
            LabelId = "Label",
            StatusId = "Status"
        }
    };

    List<Appointment> InitAppointments() {
        DateTime date = DateTime.Today.Date;
        var dataSource = new List<Appointment>() {
                new Appointment {
                    AppointmentId = 1,
                    Caption = "Website Redesign Plan",
                    StartDate = date + (new TimeSpan(1, 9, 30, 0)),
                    EndDate = date + (new TimeSpan(1, 11, 30, 0)),
                    Label = 4,
                    Status = 3
                },
                new Appointment {
                    AppointmentId = 2,
                    Caption = "Book Flights to San Fran for Sales Trip",
                    StartDate = date + (new TimeSpan(1, 12, 0, 0)),
                    EndDate = date + (new TimeSpan(1, 13, 0, 0)),
                    AllDay = true,
                    Label = 3,
                    Status = 3
                },
                new Appointment {
                    AppointmentId = 3,
                    Caption = "Install New Router in Dev Room",
                    StartDate = date + (new TimeSpan(1, 13, 30, 0)),
                    EndDate = date + (new TimeSpan(1, 15, 30, 0)),
                    Label = 5,
                    Status = 3
                },
        }
        return dataSource;
    }
}
See Also