没发现问题啊。
是不是你点击另一行了?
你窗口的文本框是绑定表中的,如果点击另一行了,文本框的值肯定会没有的。
你为何不直接用表事件呢?
如:
Select Case e.DataCol.name
Case "婚假_开始","婚假_结束"
Dim dr As DataRow = e.DataRow
If dr.IsNull("婚假_开始") = False And dr.IsNull("婚假_结束") = False
dr("婚假") = DateDiff("d",dr("婚假_开始"),dr("婚假_结束"))
Dim s As String
For i As Integer = 0 To dr("婚假")
s = s & "," & Format(dr("婚假_开始").AddDays(i),"MM.dd")
Next
dr("婚假明细") = s.Trim(",")
Else
dr("婚假") = Nothing
dr("婚假明细") = Nothing
End If
End Select