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
45049
WinDateTimeEditor 9.1.20091.2039 - The DateTime property cannot be set to a value...
posted

With the publication of the 9.1.20091.2039 service release of NetAdvantage for .NET 2009 Volume 1, we're seeing a few reports of an issue with WinDateTimeEditor when upgrading to this service release.

The issue is either a warning or an error encountered at design-time, with the following message:
"The DateTime property cannot be set to a value that is outside the range determined by the MinDate and MaxDate properties."

This issue was introduced in a previous service release, where the DateTime property could be set to null (Nothing in VB.NET).  In some cases, this would insert a line similar to the following in the Windows Forms Designer Generated Code section:

C#:
this.ultraDateTimeEditor1.DateTime = new DateTime((long) 0);

VB.NET:
Me.UltraDateTimeEditor1.DateTime = New Date(CType(0, Long))

As of this service release, this line of code should no longer be automatically inserted by the control.

The service release will not itself remove this invalid line of code, nor will the Project Upgrade Utility or Project Upgrade Add-In.  To clear the errors and warnings, manually remove this line of code from the Windows Forms Designer Generated Code section.  With the changes made in this service release, this invalid line of code should not return.

If you follow these steps and still encounter this issue, please submit a support request so that a Developer Support Engineer can assist further.  Should there be further developments with respect to this issue, I'll follow up in this thread.

Parents
No Data
Reply
  • 45049
    posted

    We also have similar reports of the same issue happening with the Value property of WinDateTimeEditor.  The line of code in the Windows Forms Designer Generated Code section looks the same, except referring to the Value property instead:

    C#:
    this.ultraDateTimeEditor1.Value = new DateTime((long) 0);

    VB.NET:
    Me.UltraDateTimeEditor1.Value = New Date(CType(0, Long))

    There are two solutions for this.  One is to remove the line from the Windows Forms Designer Generated Code section, the same as for the DateTime property.  The other option is to set the Value to null/Nothing:

    C#:
    this.ultraDateTimeEditor1.Value = null;

    VB.NET:
    Me.UltraDateTimeEditor1.Value = Nothing

Children
No Data