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

To open calendar on focus of DateTimePicker

10 Answers 516 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Avinash
Top achievements
Rank 1
Avinash asked on 25 Aug 2015, 06:03 AM
Is there any way To open calendar on focus of DateTimePicker.Also i want to hide the logo inside that control.

10 Answers, 1 is accepted

Sort by
0
Geri
Telerik team
answered on 25 Aug 2015, 03:21 PM
Hello Avinash,

In order to hide RadDateTimePicker's button, you can edit its template: just right click on it in the designer in Visual Studio and select Edit Template, then Edit a Copy. Blend will generate all the styles for you. Find the element with name "DropDownIcon" and remove the Stroke property of the two Path objects inside. This will hide the icon. Then find the element with name "ButtonChrome" and set Visibility="Collapsed".

However, this is probably of no use in your scenario, because with the current implementation of RadDateTimePicker, opening the calendar on focus cannot be easily achieved. Usually it would be possible if we hook on the GotFocus event and set the IsDropDownOpen property to "true", but when we close the dropdown, the focus gets back to RadDateTimePicker, the dropdown is opened again and so on.

A feature request is logged in our feedback portal, you can follow its progress and vote for it here:

http://feedback.telerik.com/Project/143/Feedback/Details/113402-create-property-that-allows-to-open-the-dropdown-on-focus

If you find it appropriate to your project, you can still hook to the MouseEnter event of RadDateTimePicker and open the dropdown this way.

We're sorry for any inconvenience this may be causing.
If you have any other questions, please don't hesitate to contact us.

Regards,
Geri
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Avinash
Top achievements
Rank 1
answered on 26 Aug 2015, 06:20 AM
Now my calendar is opened on got focus.But i am unable to close this when value is selected.So is there any way to close this?
0
Geri
Telerik team
answered on 26 Aug 2015, 12:37 PM
Hello Avinash,

This is an issue we are already aware of. With the current implementation of RadDateTimePicker, the desired behavior cannot be achieved, as we have already explained in our previous reply. Please, check again my previous answer for a more detailed information and refer to our feature request item for any updates on the implementation of this functionality:

http://feedback.telerik.com/Project/143/Feedback/Details/113402-create-property-that-allows-to-open-the-dropdown-on-focus

Should you have any further questions, please don't hesitate to contact us.

Regards,
Geri
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Avinash
Top achievements
Rank 1
answered on 27 Aug 2015, 05:32 AM
Ok sir,it will be better if this calendar would close on lost focus.
0
Geri
Telerik team
answered on 28 Aug 2015, 08:10 AM
Hi Avinash,

We did spend some time investigating possible solutions and managed to prepare a sample project demonstrating how the desired functionality might be achieved. Please note this functionality is not supported by the control and workaround we are suggesting might misbehave in specific scenarios. However you can try to improve it order to achieve the needed requirements.

Hope this helps.

Regards,
Geri
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Avinash
Top achievements
Rank 1
answered on 28 Aug 2015, 10:05 AM
Thank you Sir,It is now working properly.
0
Avinash
Top achievements
Rank 1
answered on 04 Sep 2015, 06:43 AM
Sir one more problem i found.When i am focusing on other control,the calendar is closing.But i want to close calendar automatically after selecting any date. 
0
Kalin
Telerik team
answered on 07 Sep 2015, 08:39 AM
Hi Avinash,

What I can suggest you would be to implement data validation for the DateTimePicker in order to indicate that there should be always selected date. For a sample implementation please check the following example from our online demos (the example is for Silverlight but the approach is identical for WPF):
http://demos.telerik.com/silverlight/#DateTimePicker/Validation

Hope this helps.

Regards,
Kalin
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Avinash
Top achievements
Rank 1
answered on 08 Sep 2015, 06:20 AM
Sir,i want what is happening on click on calendar logo inside textbox that should happen on focus on that text box.
0
Kalin
Telerik team
answered on 08 Sep 2015, 10:10 AM
Hi Avinash,

The project I attached in one of my previous replies achieves exactly the same scenario - on focus the drop down is opened. However it also closes when the focus is lost - so I suggest you to use DataValidation in order to indicate the user that needs to select a date if the changes the focus without making the selection.

Hope this helps.

Regards,
Kalin
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
DateTimePicker
Asked by
Avinash
Top achievements
Rank 1
Answers by
Geri
Telerik team
Avinash
Top achievements
Rank 1
Kalin
Telerik team
Share this question
or