Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxSchedulerTimelineView.HorizontalAppointmentTemplate Property

Specifies a template for appointments displayed in the Timeline view.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public RenderFragment<DxSchedulerAppointmentView> HorizontalAppointmentTemplate { get; set; }

#Property Value

Type Description
RenderFragment<DxSchedulerAppointmentView>

The template content for a DxSchedulerAppointmentView object.

#Remarks

@using Data

<div style="width:948px">
    <DxScheduler StartDate="@(DateTime.Today + TimeSpan.FromHours(8))"
                 DataStorage="@DataStorage">
        <DxSchedulerTimelineView Duration="@(TimeSpan.FromHours(36))" CellMinWidth="100">
            <Scales>
                <DxSchedulerTimeScale Unit="@SchedulerTimeScaleUnit.Day" UnitCount="1"></DxSchedulerTimeScale>
                <DxSchedulerTimeScale Unit="@SchedulerTimeScaleUnit.Hour" UnitCount="6"></DxSchedulerTimeScale>
            </Scales>
            <HorizontalAppointmentTemplate>
                <div class="card @context.Resource?.BackgroundCssClass">@context.Appointment.Subject <br />@context.Resource?.Caption</div>
            </HorizontalAppointmentTemplate>
        </DxSchedulerTimelineView>
    </DxScheduler>
</div>

@code {
    DxSchedulerDataStorage DataStorage = new DxSchedulerDataStorage() {
        AppointmentsSource = ResourceAppointmentCollection.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 = "ResourceId"
        },
        ResourcesSource = ResourceAppointmentCollection.GetResourcesForGrouping(),
        ResourceMappings = new DxSchedulerResourceMappings() {
            Id = "Id",
            Caption = "Name",
            BackgroundCssClass = "BackgroundCss",
            TextCssClass = "TextCss"
        }
    };
}

Scheduler - An appointment template for Timeline view

See Also