DataColChanged事件代码
If e.DataCol.Name = "日期字段1" OrElse e.DataCol.Name = "日期字段2" If e.DataRow.IsNull("日期字段1") = False And e.DataRow.IsNull("日期字段2") = False e.DataRow("间隔天数") = DateDiff("d",e.DataRow("日期字段1") ,e.DataRow("日期字段2")) End IfEnd If