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.DateHeaderCellTemplate Property

Specifies the template for date header cells in the Scheduler.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[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