This is a migrated thread and some comments may be shown as answers.

Auto year format

1 Answer 47 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Monisha
Top achievements
Rank 1
Monisha asked on 20 Mar 2015, 06:32 PM
In the Date Picker control. I want year to be custom format.

For example:

In the year field i want to type 15 and press tab it should auto populate 2015.

Is it possible?

Thanks in Advance. 

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 25 Mar 2015, 11:20 AM
Hello Monisha,

RadDatePicker control provides the possibility to modify the way the date is formatted and apply a custom format if needed. Please, check the following article from our help documentation that provides a detailed information how to achieve this:
http://docs.telerik.com/devtools/silverlight/controls/raddatetimepicker/features/formatting

For you concrete scenario you could apply the following format:
this.radDateTimePicker.Culture = new System.Globalization.CultureInfo("en-US");
this.radDateTimePicker.Culture.DateTimeFormat = new System.Globalization.DateTimeFormatInfo
{
    ShortDatePattern = "yy",
    LongDatePattern = "yyyy"
};

Also, the ParseExact property should be set to "True" and the DisplayFormat property to "Long":
 
<telerik:RadDatePicker x:Name="radDateTimePicker" ParseExact="True" DisplayFormat="Long"/>

Thus the date could be entered in its short format and be displayed in the long format.

We hope this will help you.

Regards,
Nasko
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
DatePicker
Asked by
Monisha
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or