Skip to main content

SchedulerSettings.SetHorizontalResourceHeaderTemplateContent(String) Method

Allows you to provide a template for rendering the resource header

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v23.2.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public void SetHorizontalResourceHeaderTemplateContent(
    string content
)

Parameters

Name Type Description
content String

A string value specifying the template content.

Remarks

@Html.DevExpress().Scheduler(
    settings => {
        settings.Name = "scheduler";
        ...
        settings.Views.DayView.Enabled = true;
        settings.SetHorizontalResourceHeaderTemplateContent(c => {
            int id = (int)c.Resource.Id;
            string imageUrl = string.Format("{0}?{1}={2}", SchedulerDemoHelper.GetMedicalPhotoRouteUrl(), SchedulerDemoHelper.ImageQueryKey, id);
            Html.DevExpress().Image(
                imageSettings => {
                    imageSettings.Name = string.Format("image{0}", id);
                    imageSettings.ImageUrl = imageUrl;
                    imageSettings.Properties.AlternateText = c.Resource.Caption;
                    imageSettings.Properties.ToolTip = c.Resource.Caption;
                })
                .Render();
            ViewContext.Writer.Write("<div><label style=\"text-align:center;\">" + c.Resource.Caption + "</label></div>");
        });
        ...
}).Bind(Model.Appointments, Model.Resources).GetHtml()

Online Demo

Scheduler - Templates

See Also