Set the Default Date of WPF Date Picker to Current Date

后端 未结 3 1246
情话喂你
情话喂你 2021-02-19 21:12

I have a WPF Datagrid in which one of the columns is a Date Column.

So i have used a DataTemplateColumn as Follows



        
3条回答
  •  没有蜡笔的小新
    2021-02-19 21:27

    Unless you have a property in your DataContext called Now, your Bindings will fail. Instead, you should be using the {x:Static} syntax like so:

    
        
    
    

    Since DateTime isn't in the standard XAML namespace, you need to add a xmlns declaration to the root element:

提交回复
热议问题