This project has moved. For the latest updates, please go here.

DateTimePicker Close Calendar

Aug 23, 2011 at 11:54 AM
When i select a date, how can i close the calendar automatically? now the calendar stays open and have to click some where on the form.
Aug 23, 2011 at 1:25 PM

Currently this is not supported. As a workaround you can create a handler for the ValueChanged event and set the IsOpen property to false to close it.

Aug 23, 2011 at 2:18 PM

what i have done is, converted the control to template control (for my requirement i had to convert). now added the event trigger 

<Calendar x:Name="Part_Calendar" BorderThickness="0" DisplayDate="2011-08-23" >

<EventTrigger RoutedEvent="Calendar.SelectedDatesChanged">

<BeginStoryboard>                

<Storyboard>

<BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_Popup" Storyboard.TargetProperty="(Popup.IsOpen)"> 

 <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>                         

</BooleanAnimationUsingKeyFrames>      

</Storyboard>

</BeginStoryboard>

</EventTrigger>

 </Calendar>

"PART_Popup" is the name given to popup. Now the problem i face is when i click on ToggleButton, Popup is not opening up.

Aug 23, 2011 at 7:15 PM

I'm sorry, but I cannot support modifications made to the code base as there can be numerous factors that contirbute to your issues.  All I can do is suggest you look at the source code and make sure you have all the bindings correctly setup.

Aug 7, 2012 at 12:48 AM

Is it fixed with new version of WPF Extended toolkit?  I had to implement the ValueChanged to close the calendar.

Aug 20, 2012 at 6:39 PM

The following issue has been created base on this discussion:

http://wpftoolkit.codeplex.com/workitem/18510