The reason for the DropDown portion of the DateTimePicker not getting closed when selection is made is because unlike the DatePicker/TimePicker controls there are multiple parts of the DateTime object that could be selected. When using DateTimePicker you could select a date from the calendar and select a time from the clock part of the control. In this case if the DropDown is closed after only one selection you will need to open it twice to be able to select the full date and time.
Achieving the desired behavior is easily achievable with the use of the SelectionChanged
event. In that event you will need to:
- Check if new items (new selection) have been added with the use of the SelectionChangedEventArgs
- If the previous condition is true set the IsDropDownOpen of the RadDateTimePicker control to false.
the next code snippet shows the previous approach:
and in the code behind:
sender, Telerik.Windows.Controls.SelectionChangedEventArgs e)
var dateTimePicker = sender
Hope this is helpful.
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>