Setting the WinDateTimePicker.DateTime property sends two ValueChanged, the first of which has an incorrect value RRS feed

  • Question

  • If a coded UI projects sets the date of a DateTimePicker through WinDateTimePicker.DateTime, the DateTimePicker in the app gets two ValueChanged events, the first of which may be a month or year ahead of the value it is set to.

    The event with the incorrect date causes quite a substantial problem in an app my company develops. The ValueChanged event is handled and takes an incorrect action because of it. The ValueChanged event with the correct date later received does not fix the prior incorrect action.

    I actually submitted this issue in connect a while back:


    But it was closed as 'won't fix' with no explanation and no work around. I think it's unreasonable to consider that a response for a legitimate bug I can reproduce in a simple scenario, and is problematic. I'm really looking for MS to fix this in a future version and give me a work around for VS2012/2013.

    Note that the post on the connect website has an attachment with a simple app that reproduces this issue.

    Wednesday, May 28, 2014 4:09 PM


All replies

  • Hi,

    I run your solution on my VS2012 Update4 and VS2013 Update 2 machine, I got the same issue. Even the same issue will occur when I run a new coded UI test which I created in VS through action recording using Coded UI Test Builder to select other dates.

    I think it is an issue on VS Coded UI test. I submitted a new Microsoft Connect to Microsoft: https://connect.microsoft.com/VisualStudio/feedback/details/883051/setting-the-windatetimepicker-datetime-property-sends-two-valuechanged-the-first-of-which-has-an-incorrect-value#tabs

    You can vote it. Microsoft engineers will evaluate them seriously.

    Thank you for your understanding.

    Best regards,

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Amanda Zhu Tuesday, June 3, 2014 8:50 AM
    • Marked as answer by Amanda Zhu Monday, June 9, 2014 1:34 AM
    Thursday, May 29, 2014 8:02 AM
  • Amanda, the connect post you created was closed by design by someone that misunderstood the issue. The response stated:

    "What Coded UI Test does is similar to what you user can do manually as well. If you use keyboard up down buttons to set the value, then you get multiple valuechange events."

    However, the issue has nothing to do with getting multiple events. When you change the control value manually, the dates in all ValueChange events are correct. When you do it through coded UI, the date in the first ValueChange event is an incorrect date you didn't select. That's a very substantial difference and indicates a bug in setting the value using Coded UI.

    Getting the incorrect date in the ValueChange event causes the app to not behavior correctly when the date is set through coded UI, but when you manually do the same thing the app works just fine. The way coded UI is setting the date is not correct.

    Tuesday, January 26, 2016 11:39 PM