Select Case e.DataCol.Name Case "年", "月", "日" If e.NewValue Is Nothing Then e.DataRow("所属日期结束") = Nothing Else Dim y As Integer = e.DataRow("年") Dim m As Integer = e.DataRow("月") Dim dt As New Date(y, m, Date.DaysInMonth(y,m)) '获取该月的最后一天 e.DataRow("所属日期结束") = dt End If End Select