DxSchedulerDataStorage.EnableMultipleResources Property
Specifies whether an appointment can be shared between multiple resources.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.1.dll
NuGet Package: DevExpress.Blazor
Declaration
public bool EnableMultipleResources { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
|
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:
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 }; }
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; } }
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 }; }
<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.
If you group appointments by resource, multi-resource appointments appear under all linked resources.