I have a gridview that I want to color each cell that the user has changed, as well as set an indicator on the bound data value that it has been updated. Since there appears to be no MVVM way of doing PropertyTriggers at this point, I found what appears to be the closest event to what I need. CellValidating.
With this, I have several problems:
1) In this event, I can seem to get to the OldValue and NewValue properties, except when using a RadDatePicker (and possibly other controls) in a CellEditTemplate. The NewValue always seems to be null, which indicates there is an event sequence issue here. I would expect this event to fire AFTER the DatePicker updates so that the NewValue reflects what the user selected/entered, not before, as it appears to be.
2) Because the e.Cell.OldValue and e.Cell.NewValue properties return objects (and they are indeed different instances of those objects), I cannot easily compare them accurately, especially when dealing with dates and floating points. Using ToString() is not good enough and trapping for every possible object and container type can be laborious and error prone.
So, with that....
1) Am I using the right event (or method) to capture a changed cell value event?
2) How can I best compare the old and new values to determine if the content has actually changed, rather than just instances of the objects.
With this, I have several problems:
1) In this event, I can seem to get to the OldValue and NewValue properties, except when using a RadDatePicker (and possibly other controls) in a CellEditTemplate. The NewValue always seems to be null, which indicates there is an event sequence issue here. I would expect this event to fire AFTER the DatePicker updates so that the NewValue reflects what the user selected/entered, not before, as it appears to be.
2) Because the e.Cell.OldValue and e.Cell.NewValue properties return objects (and they are indeed different instances of those objects), I cannot easily compare them accurately, especially when dealing with dates and floating points. Using ToString() is not good enough and trapping for every possible object and container type can be laborious and error prone.
So, with that....
1) Am I using the right event (or method) to capture a changed cell value event?
2) How can I best compare the old and new values to determine if the content has actually changed, rather than just instances of the objects.