你给日期列赋值的时候,就应该只赋值日期啊。
1、AfterOpenProject事件
Dim cd As System.Globalization.DateTimeFormatInfo = System.Globalization.DateTimeFormatInfo.CurrentInfo
cd.ShortDatePattern = "yyyy年MM月dd日"
Dim DateInfo As System.Reflection.FieldInfo = cd.Gettype.GetField("generalLongTimePattern", System.Reflection.BindingFlags.NonPublic Or System.Reflection.BindingFlags.Instance)
If DateInfo IsNot Nothing Then
DateInfo.SetValue(cd, "yyyy-MM-dd HH:mm:ss")
End If
2、DataRowAdded事件
e.DataRow("日期") = Date.today