SchedulerDateHeaderCellInfo Class
In This Article
Stores information about a Scheduler’s header cell that displays a date.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v25.1.dll
NuGet Package: DevExpress.Blazor
#Declaration
C#
public class SchedulerDateHeaderCellInfo
#Remarks
A SchedulerDateHeaderCellInfo
object is passed as the context
parameter to the following templates:
The parameter’s properties allow you to specify the following:
The following code snippet highlights weekends with color:
<DxScheduler @bind-StartDate="@StartDate" DataStorage="@DataStorage" CssClass="demo-sc-size">
<Views>
<DxSchedulerDayView DayCount="5" ShowWorkTimeOnly="true">
<DateHeaderCellTemplate>
<div class="@GetDateCssClass(context.Interval.Start)">
<span class="scheduler-date">@context.Interval.Start.Day</span>
<span>@context.Interval.Start.ToString("ddd")</span>
</div>
</DateHeaderCellTemplate>
</DxSchedulerDayView>
</Views>
</DxScheduler>
@code {
DateTime StartDate { get; set; } = DateTime.Today;
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"
}
};
string GetDateCssClass(DateTime date)
{
if(date.DayOfWeek == DayOfWeek.Sunday
|| date.DayOfWeek == DayOfWeek.Saturday) return "scheduler-weekend";
else return "scheduler-weekday";
}
}
See Also