5 Answers, 1 is accepted
0
Hello Abdi,
You can set the current date of the control by setting the DisplayDate of the Calendar located inside of the Template of the DatePicker. What you can do is to hook to the KeyUp event of the DatePicker, in the handler you can find the Calendar in the Template and set its DisplayDate property as desired whenever the F3 button is clicked. Please check the following code snippet and let me know if it helps as I'm not complete sure if this was the exact requirement:
Hope this will work for you.
Regards,
Kalin
Telerik
You can set the current date of the control by setting the DisplayDate of the Calendar located inside of the Template of the DatePicker. What you can do is to hook to the KeyUp event of the DatePicker, in the handler you can find the Calendar in the Template and set its DisplayDate property as desired whenever the F3 button is clicked. Please check the following code snippet and let me know if it helps as I'm not complete sure if this was the exact requirement:
private
void
RadDatePicker_KeyUp(
object
sender, KeyEventArgs e)
{
if
(e.Key == Key.F3)
{
var calendar =
this
.DatePicker.Template.FindName(
"PART_Calendar"
,
this
.DatePicker)
as
RadCalendar;
calendar.DisplayDate =
new
DateTime(2015, 1, 1);
}
}
Hope this will work for you.
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
Abdeali
Top achievements
Rank 1
answered on 12 Sep 2014, 12:12 PM
Thanks. Yes that would work. Is it possible to do this using triggers from xaml?
0
Hello Abdeali,
You can easily achieve the desired by using a KeyBinding to F3 key and execute a custom Command. Actually the DatePicker also provides DisplayDate property which can be bound to a property in the ViewModel, so whenever the Command is executed you would be able to change the property as desired. Please check the attached sample project which demonstrates the explained above.
Hope this helps.
Regards,
Kalin
Telerik
You can easily achieve the desired by using a KeyBinding to F3 key and execute a custom Command. Actually the DatePicker also provides DisplayDate property which can be bound to a property in the ViewModel, so whenever the Command is executed you would be able to change the property as desired. Please check the attached sample project which demonstrates the explained above.
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
Abdeali
Top achievements
Rank 1
answered on 19 Sep 2014, 10:39 AM
Thanks for the solution. I actually achieved the F3 shortcut by implementing Behaviors<DatePicker> in my class.
0
Hi Abdeali,
I'm glad you have managed to achieve the desired. If you have any other questions or issues, let us know.
Regards,
Kalin
Telerik
I'm glad you have managed to achieve the desired. If you have any other questions or issues, 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.