Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
560
How to cancel changes to a xamDateTimeEditor
posted

How do I accept or not the date that was picked in a xamDateTimeEditor?

I did :

private void DateTimeEditor_ValueChanged(object sender, RoutedPropertyChangedEventArgs<object> e)

{

myDateTimeEditor.Value = e.OldValue

}

But that doesn't change anything.  The new value is still displayed.  The underlying value is set correctly, but the new value is shown.  The shown value is different than the .Value property.  The Value is synchronized again when the xamDatePicker looses focus.

How can I prevent that behavior?

  • 54937
    Offline posted

    Setting the Value in the ValueChanged will result in the ValueChanged being invoked but I assume you are handling that in your real application to avoid getting stuck in an endless loop. I'm not sure if this can be supported but I've submitted an issue for it so it can be reviewed. In the interim you might try using a BeginInvoke approach similar to what I described here - http://community.infragistics.com/forums/t/38006.aspx.