Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wpf 如何在选定日期自动关闭telerik RadDateTimePicker_Wpf_Telerik_Telerik Datepicker - Fatal编程技术网

Wpf 如何在选定日期自动关闭telerik RadDateTimePicker

Wpf 如何在选定日期自动关闭telerik RadDateTimePicker,wpf,telerik,telerik-datepicker,Wpf,Telerik,Telerik Datepicker,控件声明如下: <telerik:RadDateTimePicker InputMode="DateTimePicker" IsTabStop="False" Height="36" Focusable="False" Validation.ErrorTemplate

控件声明如下:

 <telerik:RadDateTimePicker InputMode="DateTimePicker"
                            IsTabStop="False"
                            Height="36"
                            Focusable="False"
                            Validation.ErrorTemplate="{x:Null}"
                            SelectionOnFocus="SelectAll"
                            x:Name="OutwardStartDate"
                            BorderThickness="2,2,2,2"
                            SelectedValue="{Binding OutwardDepartureDate, Mode=TwoWay, ValidatesOnDataErrors=true,
                                                                     NotifyOnValidationError=true}" >
<telerik:RadDateTimePicker InputMode="DateTimePicker"
                           SelectionChanged="RadDateTimePicker_SelectionChanged"
                           IsTabStop="False"
                           Height="36"
                           Focusable="False"
                           Validation.ErrorTemplate="{x:Null}"
                           SelectionOnFocus="SelectAll"
                           x:Name="OutwardStartDate"
                           BorderThickness="2,2,2,2"
                           SelectedValue="{Binding OutwardDepartureDate,
                                               Mode=TwoWay,
                                               ValidatesOnDataErrors=true,
                                               NotifyOnValidationError=true}">


我找不到任何XAML属性,无法在选择日期时自动关闭此控件。我偶然发现了这个问题,但是这个问题是5年前提出的,目前没有一个答案解决了我的问题。

你可以简单地连接到选择更改事件

在您的XAML中,如下所示:

 <telerik:RadDateTimePicker InputMode="DateTimePicker"
                            IsTabStop="False"
                            Height="36"
                            Focusable="False"
                            Validation.ErrorTemplate="{x:Null}"
                            SelectionOnFocus="SelectAll"
                            x:Name="OutwardStartDate"
                            BorderThickness="2,2,2,2"
                            SelectedValue="{Binding OutwardDepartureDate, Mode=TwoWay, ValidatesOnDataErrors=true,
                                                                     NotifyOnValidationError=true}" >
<telerik:RadDateTimePicker InputMode="DateTimePicker"
                           SelectionChanged="RadDateTimePicker_SelectionChanged"
                           IsTabStop="False"
                           Height="36"
                           Focusable="False"
                           Validation.ErrorTemplate="{x:Null}"
                           SelectionOnFocus="SelectAll"
                           x:Name="OutwardStartDate"
                           BorderThickness="2,2,2,2"
                           SelectedValue="{Binding OutwardDepartureDate,
                                               Mode=TwoWay,
                                               ValidatesOnDataErrors=true,
                                               NotifyOnValidationError=true}">