populate the telerik RadDatePicker with current date in Xaml wpf

偶尔善良 提交于 2019-12-11 04:49:45

问题


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



来源:https://stackoverflow.com/questions/11485249/populate-the-telerik-raddatepicker-with-current-date-in-xaml-wpf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!