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
975
XamDateTimeEditor problem setting value in code behind
posted

I've switched from using a xamMonthCalendar control to a xamDateTimeEditor because I need to save on initial space on a screen.

I have code to ensure that when a "From" date is set, the min dat of the "To" date is set to that value as well, and vice-versa. This works fine and has been simply transfered to the datetimeeditor by using the ValueConstraints.

The problem comes where users can input the date manually now. That's not an issue, except that if they put in a date that's earlier than the MinInclusive of the ValueConstraint for example, I put in a check on the ValueChanged event, and pop up my own message to warn that the date can't be earlier, and I then change the value to equal the start date that's already been set.

When I step through the code, I can see that the Value of the datetimeeditor updates when I set it, but the text on the screen doesn't change, and when the control loses focus, and automatically validates against its ValueConstraints, it shows the default error message that it's an invalid value, and won't let you leave the control.

Am I missing something, do I need to set something other than the Value property, or is there some other method that I need to call on the control after setting the value (I've tried the "EndEditMode" method and all it did was instantly show the validation error rather than needing to lose focus)?

Parents
No Data
Reply
  • 9694
    posted

    Hello,

    I apologize that this post was not answered sooner. We are making the effort to ensure all posts are addressed by an Infragistics expert.

    If this is still an outstanding issue, I can help solve the issue with a little more detailed info from you (such as a XAML and code snippet of how you are implementing the XamDataTimeEditor.

    Thank you!

Children
No Data