Skip to main content

SchedulerTimelineHeaderCellInfo Class

Stores information about a header cell in the Scheduler.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

public class SchedulerTimelineHeaderCellInfo

Remarks

A SchedulerTimelineHeaderCellInfo object is passed as the context parameter to header templates. Use the Interval property to get the interval the header cell belongs to. The Scale property returns the timescale that includes the header cell.

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

Inheritance

Object
SchedulerTimelineHeaderCellInfo
See Also