填充在XAML WPF当前日期Telerik的RadDatePicker(populate the

2019-10-17 00:29发布

如何显示当前日期负载displaydate或selecteddate为RadDatePicker

                xmlns:sys="clr-namespace:System;assembly=mscorlib"

               <telerik:RadDatePicker x:Name="datepicker1" Grid.Column="1"
                    Grid.Row="1"  Margin="0,2" 
                    IsReadOnly="False"
                    AllowDrop="True"
                    SelectedDate="{x:Static sys:DateTime.Now}" DisplayDateStart="{x:Static sys:DateTime.Now}"
                    SelectedValue="{Binding  Path=SelectedDate,Mode=OneWay}"
                    />

默认情况下,RaddatePicker显示1/1/0001,如何显示当前日期?

Answer 1:

我已经尝试这样做,它工作正常,我和我有简单的DatePicker

<DatePicker x:Name="datepicker1" Grid.Column="1"   
                Grid.Row="1"  Margin="0,2"                       
                AllowDrop="True"                
                SelectedDate="{x:Static sys:DateTime.Now}"  
                />

我希望这个能帮上忙



文章来源: populate the telerik RadDatePicker with current date in Xaml wpf