How to: Fill Resource Headers with Specific Colors

This example demonstrates how to fill all resource headers with specific colors obtained from the ASPxScheduler.ResourceColorSchemas collection by handling the ASPxScheduler.CustomizeElementStyle event.

using DevExpress.Web.ASPxScheduler;
// ...

protected void ASPxScheduler1_CustomizeElementStyle(object sender, CustomizeElementStyleEventArgs e) {
    if (e.ElementType == WebElementType.VerticalResourceHeader) {
        int id = ASPxScheduler1.Storage.Resources.Items.IndexOf(e.Cell.Resource);
        e.Style.BackColor = ASPxScheduler1.ResourceColorSchemas[id % ASPxScheduler1.ResourceColorSchemas.Count].Cell;
    }
}

As a result, resource headers will be colored as time/date cells associated with corresponding resources.

ASPxScheduler_CustomizeElementStyle

See Also