Back to Devexpress

DataFormDateItem.PickerCustomYearCellStyle Event

mobilecontrols-devexpress-dot-xamarinforms-dot-dataform-dot-dataformdateitem-4b99af4e.md

latest2.4 KB
Original Source

DataFormDateItem.PickerCustomYearCellStyle Event

Allows you to customize years in the default picker.

Namespace : DevExpress.XamarinForms.DataForm

Assembly : DevExpress.XamarinForms.Editors.dll

NuGet Package : DevExpress.XamarinForms.Editors

Declaration

csharp
public event EventHandler<CustomSelectableCellStyleEventArgs> PickerCustomYearCellStyle

Event Data

The PickerCustomYearCellStyle 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 the current year.

cs
using DevExpress.XamarinForms.DataForm;

private void CustomYearCellStyle(object sender, CustomSelectableCellStyleEventArgs e) {
    if(e.Date.Year == DateTime.Now.Year)
        e.TextColor = Color.FromHex("F44848");
}
xml
<dxdf:DataFormDateItem PickerCustomYearCellStyle="CustomYearCellStyle"/>

See Also

UseNativePicker

DataFormDateItem Class

DataFormDateItem Members

DevExpress.XamarinForms.DataForm Namespace