Skip to main content

DxSchedulerTimelineView.DateHeaderCellTemplate Property

Specifies the template for date header cells in the Scheduler.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.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 Scale property to get a scale to which the Scheduler header cell belongs.

The following example adds two timescales to the Scheduler. The scales are measured in months and days, respectively. The DateHeaderCellTemplate adds the month name and dates to the corresponding scale’s header cells.

@inject WeatherForecastService ForecastService

<DxScheduler StartDate="@DateTime.Today" DataStorage="@DataStorage">
    <Views>
        <DxSchedulerTimelineView Duration="@(TimeSpan.FromHours(36))" CellMinWidth="100">
            <Scales>
                <DxSchedulerTimeScale Unit="@SchedulerTimeScaleUnit.Month" UnitCount="1" />
                <DxSchedulerTimeScale Unit="@SchedulerTimeScaleUnit.Day" UnitCount="1" />
            </Scales>
            <DateHeaderCellTemplate>
                <div style="width: 100%;">
                    <span>@(context.Scale.Unit == SchedulerTimeScaleUnit.Month ? context.Interval.Start.ToString("MMMM") : context.Interval.Start.Day)</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 - Timeline Date Header Template

See Also