Skip to main content
All docs
V26.1
  • SchedulerResourceHeaderCellInfo Class

    Stores information about a resource header cell in the Scheduler.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v26.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    public class SchedulerResourceHeaderCellInfo

    Remarks

    A SchedulerResourceHeaderCellInfo object is passed as the context parameter to resource header templates. Use the Intervals property to get intervals a resource header cell belongs. The Resource property specifies the resource associated with the resource header cell or contains an empty resource item if no resource is assigned.

    The following example adds images to resource header cells:

    <DxScheduler @bind-StartDate="@StartDate"
                 DataStorage="@DataStorage"
                 GroupType="@SchedulerGroupType.Resource"
                 ResourceColorInHeaderVisible="false"
                 HtmlCellDecoration="OnHtmlCellDecoration"
                 CssClass="demo-sc-size">
        <Views>
            <DxSchedulerDayView DayCount="2" ShowWorkTimeOnly="true" CellMinWidth="120">
                <ResourceHeaderCellTemplate>
                    <div class="d-flex align-items-center flex-row scheduler-resource-container">
                        <img class="card" src="@(StaticAssetUtils.GetEmployeeImagePath((int)context.Resource.CustomFields["EmployeeId"] + 1))"
                             alt="" />
                        <div>@context.Resource.Caption</div>
                    </div>
                </ResourceHeaderCellTemplate>
            </DxSchedulerDayView>
        </Views>
    </DxScheduler>
    @code {
        DateTime StartDate { get; set; } = DateTime.Today;
    
        DxSchedulerDataStorage DataStorage = new DxSchedulerDataStorage() {
            AppointmentsSource = ResourceAppointmentCollection.GetAppointments(),
            AppointmentMappings = new DxSchedulerAppointmentMappings() {
                Id = "Id",
                Type = "AppointmentType",
                Start = "StartDate",
                End = "EndDate",
                Subject = "Caption",
                AllDay = "AllDay",
                Location = "Location",
                Description = "Description",
                LabelId = "Label",
                StatusId = "Status",
                RecurrenceInfo = "Recurrence",
                ResourceId = "ResourceId"
            },
            ResourcesSource = ResourceCollection.GetResourcesForGrouping(),
            ResourceMappings = new DxSchedulerResourceMappings() {
                Id = "Id",
                Caption = "Name",
                BackgroundCssClass = "BackgroundCss",
                TextCssClass = "TextCss",
                CustomFieldMappings = new List<DxSchedulerCustomFieldMapping> {
                    new DxSchedulerCustomFieldMapping{ Name = "EmployeeId", Mapping = "Id" }
                }
            }
        };
    
        void OnHtmlCellDecoration(SchedulerHtmlCellDecorationEventArgs args) {
            if(args.CellType == SchedulerCellType.ResourceHeader) {
                args.CssClass = "card-header";
                args.Style = "padding: 0.4725rem;";
            }
        }
    }
    

    Scheduler - Resource Header Template

    Run Demo: Scheduler - Resource Header Template

    Inheritance

    Object
    SchedulerResourceHeaderCellInfo
    See Also