Back to Devexpress

DxScheduler.GroupType Property

blazor-devexpress-dot-blazor-dot-dxscheduler-3db66c62.md

latest4.3 KB
Original Source

DxScheduler.GroupType Property

Specifies how Scheduler appointments are grouped.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(SchedulerGroupType.None)]
[Parameter]
public SchedulerGroupType GroupType { get; set; }

Property Value

TypeDefaultDescription
SchedulerGroupTypeNone

A SchedulerGroupType enumeration value.

|

Available values:

NameDescription
None

Appointments are not grouped.

| | Resource |

Appointments are grouped by resource.

| | Date |

Appointments are grouped by date.

|

Remarks

If the Scheduler‘s appointments belong to more than one resource, use the GroupType property to group the appointments in the scheduling area. The SchedulerGroupType enumeration specifies the available group types and allow you to group appointments by date, resource, or no group.

The following code snippet display the Scheduler component grouped by resource:

razor
<DxScheduler StartDate="DateTime.Today"
             DataStorage="DataStorage"
             GroupType="SchedulerGroupType.Resource">
    <DxSchedulerDayView DayCount="3" ShowWorkTimeOnly="true"></DxSchedulerDayView>
    <DxSchedulerWeekView />
    <DxSchedulerWorkWeekView />
    <DxSchedulerTimelineView />
</DxScheduler>

@code {
    DxSchedulerDataStorage DataStorage = new DxSchedulerDataStorage() {
        AppointmentsSource = ResourceAppointmentCollection.GetAppointmentsForGrouping(),
        AppointmentMappings = new DxSchedulerAppointmentMappings() {
            Type = "AppointmentType",
            Start = "StartDate",
            End = "EndDate",
            Subject = "Caption",
            AllDay = "AllDay",
            Location = "Location",
            Description = "Description",
            LabelId = "Label",
            StatusId = "Status",
            RecurrenceInfo = "Recurrence",
            ResourceId = "ResourceId"
        },
        ResourcesSource = ResourceAppointmentCollection.GetResourcesForGrouping(),
        ResourceMappings = new DxSchedulerResourceMappings() {
            Id = "Id",
            Caption = "Text",
            BackgroundCssClass = "BackgroundCss",
            TextCssClass = "TextCss"
        }
    };
}

The following code snippet display the Scheduler component grouped by date:

razor
<DxScheduler StartDate="@DateTime.Today"
             DataStorage="@DataStorage"
             GroupType="@SchedulerGroupType.Date" >
    <DxSchedulerDayView DayCount="3" ShowWorkTimeOnly="true"></DxSchedulerDayView>
    <DxSchedulerWeekView />
    <DxSchedulerWorkWeekView />
    <DxSchedulerTimelineView />
</DxScheduler>

@code {
    DxSchedulerDataStorage DataStorage = new DxSchedulerDataStorage() {
        AppointmentsSource = ResourceAppointmentCollection.GetAppointmentsForGrouping(),
        AppointmentMappings = new DxSchedulerAppointmentMappings() {
            Type = "AppointmentType",
            Start = "StartDate",
            End = "EndDate",
            Subject = "Caption",
            AllDay = "AllDay",
            Location = "Location",
            Description = "Description",
            LabelId = "Label",
            StatusId = "Status",
            RecurrenceInfo = "Recurrence",
            ResourceId = "ResourceId"
        },
        ResourcesSource = ResourceAppointmentCollection.GetResourcesForGrouping(),
        ResourceMappings = new DxSchedulerResourceMappings() {
            Id = "Id",
            Caption = "Text"
            Color = "Color",
            BackgroundCssClass = "BackgroundCss",
            TextCssClass = "TextCss"
        }
    };
}

See Also

DxScheduler Class

DxScheduler Members

DevExpress.Blazor Namespace