Marin
Marin

Reputation: 1321

Datepicker - year only?

I want to use Datepicker control, but with only YEAR displayed and shown to user for edit. Is it possible to remove the month and day fields?

Upvotes: 0

Views: 1480

Answers (4)

Pankaj Parag
Pankaj Parag

Reputation: 437

I used ValueStringFormat="{}{0:yyyy} for toolkit:DatePicker, which displays only Year but sadly still shows days and months for editing. Or you can use Longlistpicker which is described in detail here.

Upvotes: 0

Eric
Eric

Reputation: 36

Check out Telerik controls for Windows Phone. It provides a very easy way to do formatting of the DatePicker popup. In your case I believe you would want to use this xaml

<telerikInput:RadDatePicker x:Name="radDatePicker" SelectorFormat="y" />

Here's the documentation for customizing Telerik controls Telerik DatePicker documentation

Upvotes: 1

Ku6opr
Ku6opr

Reputation: 8126

Silverlight Toolkit comes in source codes also, so you can add code files that used DatePicker and modify Picker Page. I don't see easiest way to modify/reproduce date picker

Upvotes: 2

Pedro Lamas
Pedro Lamas

Reputation: 7233

The DatePicker control in the Silverlight for Windows Phone Toolkit doesn't have that kind of direct customization!

You'll have to change the picker control and the full page it uses; you can check here for some info about DatePicker customization, though it is quite sparse...

Upvotes: 5

Related Questions