populate the telerik RadDatePicker with current da

2019-08-01 13:08发布

问题:

how to show the displaydate or selecteddate on load for RadDatePicker with current date

                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}"
                    />

by default the RaddatePicker shows the 1/1/0001, how to show the current date ?

回答1:

I have tried this and it works fine with me and i had simple DatePicker

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

I hope this will help