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

SelectAll and CloseDropDown when SelectionChanged

1 Answer 36 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Adam Marshall
Top achievements
Rank 1
Adam Marshall asked on 25 Jul 2010, 11:52 PM
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

1 Answer, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 28 Jul 2010, 09:20 AM
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
Tags
DateTimePicker
Asked by
Adam Marshall
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Share this question
or