I want to show only year on raddatepicker , and the user can enter a value is year.
But it will error if I just enter the value in 2014,but if I enter 01/01/2014, there is no error message.
In the hidden code:
XAML:
Sorry my english :)
But it will error if I just enter the value in 2014,but if I enter 01/01/2014, there is no error message.
In the hidden code:
timePicker.Culture.DateTimeFormat =
new
System.Globalization.DateTimeFormatInfo ShortDatePattern = {
"yyyy"
};
XAML:
DateSelectionMode = "Year"
Sorry my english :)
6 Answers, 1 is accepted
0
Hello Minh,
When displaying and selecting only years you should also set the ParseExact property of the DatePicker to true:
Hope this helps.
Regards,
Kalin
Telerik
When displaying and selecting only years you should also set the ParseExact property of the DatePicker to true:
<
telerik:RadDatePicker
ParseExact
=
"False"
x:Name
=
"Picker"
DateSelectionMode
=
"Year"
/>
Hope this helps.
Regards,
Kalin
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
0
Minh
Top achievements
Rank 1
answered on 08 Jul 2014, 08:15 AM
Thanks for the reply,
But,I added, but the error is still not resolved :(
But,I added, but the error is still not resolved :(
0
Minh
Top achievements
Rank 1
answered on 08 Jul 2014, 08:29 AM
it solves one part of my request, so pretty good.
Tks
Tks
0
Hi Minh,
You would need to enter the whole year in order to parse it correctly. If you have any further questions, let us know.
Regards,
Kalin
Telerik
You would need to enter the whole year in order to parse it correctly. If you have any further questions, let us know.
Regards,
Kalin
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
0
Minh
Top achievements
Rank 1
answered on 08 Jul 2014, 09:03 AM
It seems that it has 4 mandatory character,
and how to turn off the message "error"?
so, I can check it in LostFocus event
and how to turn off the message "error"?
so, I can check it in LostFocus event
0
Hi Minh,
What I can suggest you would be to check the following article from our online help documentation:
http://www.telerik.com/help/wpf/raddatetimepicker-how-to-implement-custom-parsing.html
Using the custom parsing you can implement a custom logic which parses correctly only one, two or three digits. You will avoid the error message when the args.IsParsingSuccessful property is set to true.
Hope this helps.
Regards,
Kalin
Telerik
What I can suggest you would be to check the following article from our online help documentation:
http://www.telerik.com/help/wpf/raddatetimepicker-how-to-implement-custom-parsing.html
Using the custom parsing you can implement a custom logic which parses correctly only one, two or three digits. You will avoid the error message when the args.IsParsingSuccessful property is set to true.
Hope this helps.
Regards,
Kalin
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.