Hi,
I'm having an issue with the UltraDateTimeEditor and can't seem to figure out a proper workaround. Demoproject attached, vs2012 infragistics 2015.1.
My UltraDateTimeEditor value is bound to my object, and the binding is set as "onpropertychanged".
When the users changes the data using the control, i'd like to catch this event to do some validation on my object, depending on the new value. However, when valuechanged fires, the control.value has contains new value entered by the user, but my object doesn't. The new value seems to only get propagated once the datetimepicker loses focus.
I'm having a similar issue with the ultracombo valuechanged event (not in the demo project).
Am I missing something? What event fires after the data has been comitted to my object?
If you can tell me more details about exactly what you are trying to achieve, I might be able to point you in the right direction.
Thanks for your valuable feedback Mike! I'll have to rethink my validation setup then.
I don't think this will work reliably because of the way the BindingManager works. The BindingManager is going to hook the ValueChanged event on the control, just like you are doing in your sample. So there are two listeners to this event and there is no way to determine which one will get the event first. So your sample might work sometimes (if the BindingManager gets the event notification first) or it might not (if you get it first).
There's no event that fires specifically when the change is committed as far as I know. But since the Data object is your own custom class here, you could use the property setter for the Timestamp property.
Another option would be to use the Parse event on the Binding which fires whenever the BindingManager applies a property from the UI to the data source. This event is intended to give you an opportunity to translate the value from something in the UI (typically a string) into something the data source can handle. Of course, this event fires before the data is written to the data source, so it's probably not better than using the ValueChanged on the UltraDateTimeEditor in that regard - except that it will always fire before the change is written to the data source.