Restricting date value to year only in WPF DateTimeEdit control

I'm using DateTimeEdit control:


<DateTimeEdit

CanEdit="True"

CustomPattern="yyyy"

Pattern="CustomPattern"

DisableDateSelection="True" />

With this code I can have this result: the calendar only shows month and year:

Image_4230_1695122401884


But I need a calendar that only shows the year, like this:

Image_1526_1695122525801

 Is it possible?


2 Replies

MJ Madhumithan Jayapathi Syncfusion Team September 22, 2023 11:09 AM UTC

Hi Elisa,

We have reviewed your query and, unfortunately, there is no direct support to configure the DateTimeEdit to display only the year. However, we are checking whether there is any workaround to achieve this functionality. We will check and update you with complete details on or before 26th September 2023. We appreciate your patience until then.

Regards,
Madhumithan Jayapathi



MJ Madhumithan Jayapathi Syncfusion Team September 26, 2023 09:48 AM UTC

Hi Elisa,

We have reviewed your query, and unfortunately, there is no direct support or workaround to select only a date in SfDateTimeEdit. However, you can achieve this functionality by using the SfDatePicker control. We have attached the code snippet for your reference and please let us know if you need any further assistance.

<syncfusion:SfDatePicker FormatString="yyyy" SelectorFormatString="Y" />


Regards,
Madhumithan Jayapathi


Loader.
Up arrow icon