When the user selects a date in the RadDatePicker, I need the date to be displayed as dd/MM/yyyy. How can I get this format, dd/MM/yyyy, to be displayed in the control?
my xaml
<
telerik:RadDatePicker
Name
=
"myDatePicker"
InputMode
=
"DatePicker"
Height
=
"30"
HorizontalAlignment
=
"Stretch"
/>
5 Answers, 1 is accepted
0
Accepted
Hello Amrit,
Please, check this online help article on the topic of formatting in the RadDateTimePicker control(RadDateTimePicker with InputMode="DatePicker" is the same as RadDatePicker). It describes how you can specify custom formatting. I hope it helps.
Greetings,
Dani
the Telerik team
Please, check this online help article on the topic of formatting in the RadDateTimePicker control(RadDateTimePicker with InputMode="DatePicker" is the same as RadDatePicker). It describes how you can specify custom formatting. I hope it helps.
Greetings,
Dani
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Top Gun
Top achievements
Rank 1
answered on 09 Jun 2011, 03:38 PM
Thanks. I appreciate the help.
0
David
Top achievements
Rank 1
answered on 20 Nov 2012, 05:33 AM
Hi,
I don't use code-behind (we use MVVM) - how can I do this in XAML?
Thanks
I don't use code-behind (we use MVVM) - how can I do this in XAML?
Thanks
0
Hi Rodney,
Currently there is no way to set the format in XAML. You can only set this as shown in the link below. In MVVM scenario you can try to achieve this by binding the Culture property of the DateTimePicker to your ViewModel. As this is not very convenient we have logged this in our PITS, you can follow the items progress and vote for it here.
Regards,
Boyan
the Telerik team
Currently there is no way to set the format in XAML. You can only set this as shown in the link below. In MVVM scenario you can try to achieve this by binding the Culture property of the DateTimePicker to your ViewModel. As this is not very convenient we have logged this in our PITS, you can follow the items progress and vote for it here.
Regards,
Boyan
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0
David
Top achievements
Rank 1
answered on 25 Feb 2013, 04:12 AM
Thanks, I went this route:
and in my View:
public
CultureInfo CultureWithFormattedPeriod
{
//Hack to get around the fact that there is no custom date format in the Telerik DatePicker
get
{
var tempCultureInfo = (CultureInfo)CultureInfo.CurrentCulture.Clone();
tempCultureInfo.DateTimeFormat.ShortDatePattern =
"MMyyyy"
;
return
tempCultureInfo;
}
}
and in my View:
<
telerik:RadDateTimePicker
Culture
=
"{Binding Path=CultureWithFormattedPeriod}"
InputMode
=
"DatePicker"
DateSelectionMode
=
"Month"
SelectedValue
=
"{Binding Path=ExtendedEditor.From, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=True}"
/>