Back to Devexpress

DataFormDateItem.PickerCustomDayCellStyle Event

mobilecontrols-devexpress-dot-xamarinforms-dot-dataform-dot-dataformdateitem-8b94dcc0.md

latest2.8 KB
Original Source

DataFormDateItem.PickerCustomDayCellStyle Event

Allows you to customize days in the default picker.

Namespace : DevExpress.XamarinForms.DataForm

Assembly : DevExpress.XamarinForms.Editors.dll

NuGet Package : DevExpress.XamarinForms.Editors

Declaration

csharp
public event EventHandler<CustomSelectableCellStyleEventArgs> PickerCustomDayCellStyle

Event Data

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

PropertyDescription
DateGets or sets 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 style to a specific day.

cs
using DevExpress.XamarinForms.DataForm;

void CustomDayCellStyle(object sender, CustomSelectableCellStyleEventArgs e) {
    if(e.Date.Month == 2 && e.Date.Day == 14) {
        e.FontAttributes = FontAttributes.Bold;
        e.EllipseBackgroundColor = Color.FromRgba(e.TextColor.R, e.TextColor.G, e.TextColor.B, 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.R, textColor.G, textColor.B, 0.25);
        e.TextColor = textColor;
    }   
}
xml
<dxdf:DataFormDateItem PickerCustomDayCellStyle="CustomDayCellStyle"/>

See Also

UseNativePicker

DataFormDateItem Class

DataFormDateItem Members

DevExpress.XamarinForms.DataForm Namespace