To open calendar on focus of DateTimePicker

11 posts, 0 answers
  1. Avinash
    Avinash avatar
    31 posts
    Member since:
    May 2015

    Posted 25 Aug 2015 Link to this post

    Is there any way To open calendar on focus of DateTimePicker.Also i want to hide the logo inside that control.
  2. Geri
    Admin
    Geri avatar
    60 posts

    Posted 25 Aug 2015 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Avinash
    Avinash avatar
    31 posts
    Member since:
    May 2015

    Posted 26 Aug 2015 in reply to Geri Link to this post

    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?
  5. Geri
    Admin
    Geri avatar
    60 posts

    Posted 26 Aug 2015 Link to this post

    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
  6. Avinash
    Avinash avatar
    31 posts
    Member since:
    May 2015

    Posted 27 Aug 2015 in reply to Geri Link to this post

    Ok sir,it will be better if this calendar would close on lost focus.
  7. Geri
    Admin
    Geri avatar
    60 posts

    Posted 28 Aug 2015 Link to this post

    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
  8. Avinash
    Avinash avatar
    31 posts
    Member since:
    May 2015

    Posted 28 Aug 2015 in reply to Geri Link to this post

    Thank you Sir,It is now working properly.
  9. Avinash
    Avinash avatar
    31 posts
    Member since:
    May 2015

    Posted 04 Sep 2015 Link to this post

    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. 
  10. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 07 Sep 2015 Link to this post

    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
  11. Avinash
    Avinash avatar
    31 posts
    Member since:
    May 2015

    Posted 08 Sep 2015 in reply to Kalin Link to this post

    Sir,i want what is happening on click on calendar logo inside textbox that should happen on focus on that text box.
  12. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 08 Sep 2015 Link to this post

    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
Back to Top
UI for WPF is Visual Studio 2017 Ready