As long as I pick a time from the dropdown, everything works OK, but in the RowValidating event, if I type a time directly into the textbox and then click on another row, the e.Row.DataContext still has the old value. However, if I tab to the next column, the value is updated.
I think this is a bug. The DataContext should update, no matter how you exit the cell, prior to the RowValidating event.
So, to give you a specific example, here is my RowValidating code:
If I edit a row with an 11:00 AM start time and a 1:00 PM end time, changing the end time to 11:01 PM, I should get an error message since the elapsed time is greater than 12 hours, but if I exit the end time field by clicking on another row in the same column, the end time in the DataContext is still 1:00 PM and no error is triggered. If I come back to the row to edit it again, the DataContext and the underlying binding have the new invalid time, 11:01 PM.
How can I resolve this problem?
Thanks,
Terry