Skip to main content
All docs
V24.2

DxSchedulerDataStorage.EnableMultipleResources Property

Specifies whether an appointment can be shared between multiple resources.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public bool EnableMultipleResources { get; set; }

Property Value

Type Description
Boolean

true if a Scheduler appointment can have multiple resources; otherwise, false.

Remarks

The DevExpress Blazor Scheduler component allows you to assign multiple resources to an appointment. This feature is useful for the following cases: meetings with multiple participants, group events, or services that require coordination among various resources.

Follow the steps below to enable this functionality:

  1. Set the EnableMultipleResources property to ‘true’.

    @code {
        DxSchedulerDataStorage DataStorage = new DxSchedulerDataStorage() {
            AppointmentsSource = MultipleResourceAppointmentCollection.GetAppointments(),
            AppointmentMappings = new DxSchedulerAppointmentMappings() {
                ...
            },
            ResourcesSource = ResourceCollection.GetResources(),
            ResourceMappings = new DxSchedulerResourceMappings() {
                ...
            },
            EnableMultipleResources = true
        };
    }
    
  2. Add a new data field (Resources) to an appointment’s source object.

    public class Appointment {
        public Appointment() { }
        public int AppointmentType { get; set; }
        public DateTime StartDate { get; set; }
        public DateTime EndDate { get; set; }
        ...
        public string Resources { get; set; }
    }
    
  3. Map this field to the ResourceId appointment property.

    @code {
        DxSchedulerDataStorage DataStorage = new DxSchedulerDataStorage() {
            AppointmentsSource = ResourceAppointmentCollection.GetMultipleResourceAppointments(),
            AppointmentMappings = new DxSchedulerAppointmentMappings() {
                ...
                ResourceId = "Resources"
            },
            ResourcesSource = ResourceCollection.GetResources(),
            ResourceMappings = new DxSchedulerResourceMappings() {
                ...
            },
            EnableMultipleResources = true
        };
    }
    
Show Complete Code
<DxScheduler @bind-StartDate="@StartDate"
             DataStorage="@DataStorage"
             GroupType="SchedulerGroupType.Resource"
             CssClass="demo-sc-size"
             AppointmentFormMode="SchedulerAppointmentFormMode.EditForm">
    <DxSchedulerDayView DayCount="2" ShowWorkTimeOnly="true"></DxSchedulerDayView>
</DxScheduler>

@code {
    DateTime StartDate { get; set; } = DateTime.Today;
    DxSchedulerDataStorage DataStorage = new DxSchedulerDataStorage() {
        AppointmentsSource = MultipleResourceAppointmentCollection.GetAppointments(),
        AppointmentMappings = new DxSchedulerAppointmentMappings() {
            Type = "AppointmentType",
            Start = "StartDate",
            End = "EndDate",
            Subject = "Caption",
            AllDay = "AllDay",
            Location = "Location",
            Description = "Description",
            LabelId = "Label",
            StatusId = "Status",
            RecurrenceInfo = "Recurrence",
            ResourceId = "Resources"
        },
        ResourcesSource = ResourceCollection.GetResources(),
        ResourceMappings = new DxSchedulerResourceMappings() {
            Id = "Id",
            Caption = "Name",
            BackgroundCssClass = "BackgroundCss",
            TextCssClass = "TextCss"
        },
        EnableMultipleResources = true
    };
}

Users can specify multiple resources in the Appointment edit form.

Appoitment edit form - Multiple Resources

If you group appointments by resource, multi-resource appointments appear under all linked resources.

Grouped Multiple Resources

Run Demo: Scheduler Resources - Multiple Resources

See Also