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

DateTimePicker resets time in Expander

Sep 13, 2013 at 9:04 PM
I have a DateTimePicker within an expander. When i open the expander the first time, the time resets to 00:00.00. From then on, the time will never reset.
<Expander>
     ....
     <extToolkit:DateTimePicker Margin="5" MinWidth="100" Value="{Binding StartTimeDateTime}" Format="Custom" FormatString="yyyy/MM/dd,HH:mm:ss" AutoCloseCalendar="True" />
     ....
</Expander>
Anyone have any suggestions?
Developer
Sep 16, 2013 at 1:46 PM
Hi,

Based on this small sample, opening the DateTimePicker from an expander shows the expected time, without resets at 00:00:00.
<Window x:Class="WpfApplication40.MainWindow"
        x:Name="CurrentWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
      <Expander>
         <xctk:DateTimePicker Margin="5" MinWidth="100" Value="{Binding StartTimeDateTime, ElementName=CurrentWindow}" Format="Custom" FormatString="yyyy/MM/dd,HH:mm:ss" AutoCloseCalendar="True" />
      </Expander>
    </Grid>
</Window>

 public partial class MainWindow : Window
  {
    public MainWindow()
    {
      this.StartTimeDateTime = new DateTime( 2010, 7, 31, 13, 30, 0 );
      InitializeComponent();
    }

    public DateTime StartTimeDateTime
    {
      get;
      set;
    }
  }