Skip to main content

DataFormDateItem.PickerCustomDayCellAppearance Event

Allows you to customize the appearance of day cells in the default picker.

Namespace: DevExpress.Maui.DataForm

Assembly: DevExpress.Maui.Editors.dll

NuGet Package: DevExpress.Maui.Editors

Declaration

public event EventHandler<CustomSelectableCellAppearanceEventArgs> PickerCustomDayCellAppearance

Event Data

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

Property Description
Date Gets the processed day.
EllipseBackgroundColor Gets or sets the color of the processed day’s selection ellipse.
IsSelected Gets whether the processed day is selected.
IsTrailing Gets 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.

Custom Day Appearance

using DevExpress.Maui.DataForm;

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;
    }   
}
<dxdf:DataFormDateItem PickerCustomDayCellAppearance="CustomDayCellAppearance"/>
See Also