Skip to main content

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

[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