Back to Devexpress

DXCalendar.CustomDayCellAppearance Event

maui-devexpress-dot-maui-dot-editors-dot-dxcalendar-d6351dd4.md

latest2.5 KB
Original Source

DXCalendar.CustomDayCellAppearance Event

Allows you to customize days.

Namespace : DevExpress.Maui.Editors

Assembly : DevExpress.Maui.Editors.dll

NuGet Package : DevExpress.Maui.Editors

Declaration

csharp
public event EventHandler<CustomSelectableCellAppearanceEventArgs> CustomDayCellAppearance

Event Data

The CustomDayCellAppearance event's data class is CustomSelectableCellAppearanceEventArgs. The following properties provide information specific to this event:

PropertyDescription
DateGets the processed day.
EllipseBackgroundColorGets or sets the color of the processed day’s selection ellipse.
IsSelectedGets whether the processed day is selected.
IsTrailingGets whether the processed day belongs to the previous or next month.

Example

The example below shows how to apply a custom appearance to a specific day.

cs
using DevExpress.Maui.Editors;

void CustomDayCellAppearance(object sender, CustomSelectableCellAppearanceEventArgs e) {
    if(e.Date.Month == 2 && e.Date.Day == 14) {
        e.FontAttributes = FontAttributes.Bold;
        e.EllipseBackgroundColor = Color.FromRgba(e.TextColor.Red, e.TextColor.Green, e.TextColor.Blue, 0.15);
    }

    if(e.Date.Month == 2 && e.Date.Day == 21) {
        e.FontAttributes = FontAttributes.Bold;
        Color textColor = Color.FromHex("F44848");
        e.EllipseBackgroundColor = Color.FromRgba(textColor.Red, textColor.Green, textColor.Blue, 0.25);
        e.TextColor = textColor;
    }   
}
xml
<dx:DXCalendar CustomDayCellAppearance="CustomDayCellAppearance"/>

See Also

DXCalendar Class

DXCalendar Members

DevExpress.Maui.Editors Namespace