Skip to main content

DxSchedulerTimelineView.DateHeaderCellTemplate Property

Specifies the template for date header cells in the Scheduler.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public RenderFragment<SchedulerTimelineHeaderCellInfo> DateHeaderCellTemplate { get; set; }

Property Value

Type Description
RenderFragment<SchedulerTimelineHeaderCellInfo>

The date header cell template.

Remarks

This template accepts a SchedulerTimelineHeaderCellInfo object as the context parameter. You can use the parameter’s Interval property to get the interval to which the cell belongs.

The following example adds dates and abbreviated day names to date header cells:

<DxScheduler StartDate="@DateTime.Today"
             DataStorage="@DataStorage"
             GroupType="@SchedulerGroupType.Resource">
    <Views>
        <DxSchedulerTimelineView Duration="TimeSpan.FromDays(2)">
            <Scales>
                <DxSchedulerTimeScale Unit="SchedulerTimeScaleUnit.Day"></DxSchedulerTimeScale>
            </Scales>
            <DateHeaderCellTemplate>
                <div style="width: 100%;">
                    <span>@context.Interval.Start.Day @context.Interval.Start.ToString("ddd")</span>
                </div>
            </DateHeaderCellTemplate>
        </DxSchedulerTimelineView>
    </Views>
</DxScheduler>

@code {
    DxSchedulerDataStorage DataStorage = new DxSchedulerDataStorage() {
        AppointmentsSource = AppointmentCollection.GetAppointments(),
        AppointmentMappings = new DxSchedulerAppointmentMappings() {
            Type = "AppointmentType",
            Start = "StartDate",
            End = "EndDate",
            Subject = "Caption",
            AllDay = "AllDay",
            Location = "Location",
            Description = "Description",
            LabelId = "Label",
            StatusId = "Status",
            RecurrenceInfo = "Recurrence"
        }
    };
}

Scheduler - Date Header Template

Run Demo: Scheduler - Date Header Template

See Also