CustomizeElementStyleEventArgs.Style Property
Get the style that defines the appearance of a visual element within the scheduler control.
Namespace: DevExpress.Web.ASPxScheduler
Assembly: DevExpress.Web.ASPxScheduler.v24.2.dll
NuGet Package: DevExpress.Web.Scheduler
#Declaration
#Property Value
Type | Description |
---|---|
Style | A Style object that contains style settings. |
#Remarks
Use Style to access an object providing different properties whose values you can change to control the appearance of an ASPxScheduler control’s visual element. For example, you can specify an element’s foreground, background and border colors, the font settings, etc. 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. Use the CustomizeElementStyleEventArgs.Cell property to determine the resource and time interval corresponding to the process visual element. 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.
#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;
}
}