SelectAll and CloseDropDown when SelectionChanged

2 posts, 0 answers
  1. Adam Marshall
    Adam Marshall avatar
    46 posts
    Member since:
    Nov 2009

    Posted 25 Jul 2010 Link to this post

    Hi,

    I am going through replacing any RadDatePicker's I have with the RadDateTimePicker and have come across a couple of things.

    Can I suggest that when the InputMode is set to DatePicker only, that when a selection is made, the calendar drop down automatically closes. I know this wouldn't work for DataTimePicker mode, but perhaps a property could be exposed to switch it on for DataPicker and TimePickers? I have created an attached property to create the desired behaviour so it's working well for me in that sense.

    The other issue I have is when the RadDatePicker has focus by a mouse click. I have noticed that the SelectAll and Select methods have been deprecated, and that the DatePicker automatically selects all when it receives keyboard focus.

    This is the desired behaviour I have, however, if the mouse is used to give the control focus, the text is selected briefly but then immediatly is deselected and the cursor is placed at the mouse click.

    Normally to overcome this, I would handle the PreviewMouseLeftButtonDown event by checking the RadDateTimePicker.IsKeyboardFocusWithin property. This still works, however it basically stops the Calendar from being opened when the DatePicker does not have focus and the RadButton is clicked.

    My question, can the DatePicker SelectAll behaviour be modified so when it is focused via a mouse click, the text stays focused and does not immediatly de-select all?

    Thanks,

    Adam Marshall
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 28 Jul 2010 Link to this post

    Hello Adam,

     We logged this issue in our PITS and you can use the following PITS item ID to track its progress - 2872. What I could suggest you to overcome this is to use your approach is to handle the PrevewMousDown but only if the OriginalSource of the routed event is within the MaskedTextBox control and not within the DropDownButton of the Calendar.

    Hope this helps!

    All the best,
    Miroslav Nedyalkov
    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
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top