HI,
I inherit the XamDateTimeEditor and on the OnEditModeValidationError I want to put a value (based on different criteria) into the editor.
This work well using:
this.Value = <my computed datetime value> args.Handled = true; args.InvalidValueBehavior = InvalidValueBehavior.RetainValue; However the focus is still in the datetime editor (ie. don't moves to the next control). If I don't set the args.InvalidValueBehavior an error message is displayed.
Is there any way I can make the XamDateTimeEditor behave like it had (and in fact have) a valid value and loose focus (as it would normally do)?
Thanks
The only InvalidValueBehavior that does not keep focus is the RevertValue option. However that will reset the Value back to the OriginalValue so what you probably want to do is use RevertValue but after you set the Value, call the InitializeOriginalValueFromValue method so the value remains what you set it to.