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

Show only popup of DateTimePicker

Jan 10, 2014 at 10:27 AM
Hello,

I'm a newbie in WPF and WPF Toolkit.

In my case, the user will open the DateTimePicker via clicking a Button to show the popup (Calender and TimePicker).

I have to remove the textbox and dropdown button of the DateTimePicker.

How can I realize this case?


Thanks in advanced
Gulumser
Developer
Jan 10, 2014 at 1:11 PM
Hi,

You could use a DropDownButton with a DropDownContent containing the Calendars and TimePicker :
<Grid>
      <xctk:DropDownButton x:Name="_dropDownButton"
                           Margin="10"
                           Width="150"
                           Height="25"
                           Content="Click Me">
         <xctk:DropDownButton.DropDownContent>
            <StackPanel>
               <Calendar />
               <xctk:TimePicker />
            </StackPanel>
         </xctk:DropDownButton.DropDownContent>
      </xctk:DropDownButton>
   </Grid>
Or use a button and on the Click event, show a childWindow containing the Calendar and TimePicker :
 <Grid>
      <Button Margin="10"
              Width="150"
              Height="25"
              Content="Click Me"
              Click="Button_Click_1"/>

      <xctk:WindowContainer x:Name="_windowContainer"
                            ModalBackgroundBrush="#80000000">

         <xctk:ChildWindow x:Name="_modalChildWindow"
                           Caption="Modal ChildWindow"
                           IsModal="True"
                           Left="175"
                           Top="50"
                           WindowState="Closed">
            <StackPanel>
               <Calendar />
               <xctk:TimePicker />
            </StackPanel>
         </xctk:ChildWindow>
      </xctk:WindowContainer>
   </Grid>


private void Button_Click_1( object sender, RoutedEventArgs e )
    {
      _modalChildWindow.WindowState = Xceed.Wpf.Toolkit.WindowState.Open;
    }
Jan 14, 2014 at 1:34 PM
BoucherS,

your first Solution is exactly what I need.

Thanks a lot.