Set the Default Date of WPF Date Picker to Current Date

后端 未结 3 964
情话喂你
情话喂你 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条回答
  •  猫巷女王i
    2021-02-19 21:32

    On top of Abe Heidebrecht's Answer I am providing an example. I think Abe's answer is correct. I had the same issue with new object and class binding and solved the problem in the way mentioned below:

     get
     {
      return (ClassDate - DateTime.MinValue).TotalDays == 0 ? DateTime.Now :ClassDate;
     }
    

    cheers :)

提交回复
热议问题