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

Date only DateTimePicker

Apr 25, 2012 at 10:44 AM

The toolkit has a TimePicker and a DateTimePicker but is there any way to get a date only picker? I can set the format property in the DateTimePicker to be just a date but it still prompts for a time when the dropdown caldendar box is displayed.

Could there be an easy way of hiding the time part of the dropdown? (I know WPF 4 has a DatePicker control but I want to try and keep my date/time pickers looking the same with minimum styling).

Cheers

Coordinator
Apr 25, 2012 at 6:32 PM

Have you tried to set an implicit style on the TimePicker within your DateTimePicker's style like this?

 

<xctk:DateTimePicker>
   <xctk:DateTimePicker.Style>
      <Style>
         <Style.Resources>
            <Style TargetType="{x:Type xctk:TimePicker}">
               <Setter Property="Visibility"
                       Value="Collapsed" />
            </Style>
         </Style.Resources>
      </Style>
   </xctk:DateTimePicker.Style>
</xctk:DateTimePicker>
Apr 25, 2012 at 10:24 PM

Thankyou - thats worked a treat. I hadn't thpught of using an implicit style in this way.

Cheers