CustomizeElementStyleEventArgs.Cell Property
Gets an object providing access to a resource and time interval corresponding to a visual element.
Namespace: DevExpress.Web.ASPxScheduler
Assembly: DevExpress.Web.ASPxScheduler.v23.2.dll
NuGet Package: DevExpress.Web.Scheduler
Declaration
Property Value
Type | Description |
---|---|
DevExpress.XtraScheduler.Drawing.ITimeCell | A DevExpress.XtraScheduler.Drawing.ITimeCell object. |
Remarks
To obtain the type of the element (date header, vertical or horizontal resource header, all-day area, selection bar, date cell body or date cell header, etc.) to which the style should be applied, use the CustomizeElementStyleEventArgs.ElementType property. To obtain whether an element should have a specific appearance (for example, date headers and date cells corresponding to today’s date), use the CustomizeElementStyleEventArgs.IsAlternate property. To specify attributes of a style to be applied to a visual element, use properties of the object accessed via CustomizeElementStyleEventArgs.Style.
Example
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;
}
}