none
DateTimePicker BUG with single digit date. RRS feed

  • Question

  • We have a form that use LinqToSQL BusinessEntity data (visualizes and allows users to modify them).
    Inside a form. we also have a ToolStripMenu with a button for validate (using this.Validate(true); ) and save data.
    In this form we have: 
    -          A TextBox for a description field
    -          A DateTimePicker for a date field

    If we modify the description, validate and save correctly works.
    If we modify the date in DateTimePicker, validate and save work only for date with day of two digits (for example 12).
    If the date has a day with single digit, save button doesn’t work (for example 2).
    So, there is a big problem in managing date field.
     
    We can give you a small test project with related database (database consist of three sample table).

     


    FabioBo
    Monday, June 27, 2011 6:41 AM

Answers

  • Hello FabioBo,

    Thank you for posting.

    I read your post carefully, but I cannot find anything very helpful information from your description. In your latest reply, you have eliminated your question into DateTimePicker control itself. So my option is:

    1. Could you please provide more detailed code snippets and steps to us to help us reproduce your issue on our sides? You can send the project directly to me. v-xugong@microsoft.com

    If you have any finding, please feel free to let us know.

    Best Regards,

    [Mail]:

    Hello,

     

    I followed this case nowadays. Here’s my update from the product group. As I mentioned in the previous mail, this is an intentional behavior for the control. It doesn’t think there is anything to validate when the input is incomplete.

     

    Please feel free to let me know if you have any question.

    Best Regards,

    Larcolais Gong

     

    From: Xueyun Gong

    Sent: Wednesday, June 29, 2011 4:09 PM
    To: 'Fabio Borghi'
    Subject: RE: DateTimePicker BUG

     

    Hello again,

     

    After I checked your code sample, first of all, it looks that we should type at least 2 words into it and then invoked this event. We can also use ValueChanged event to achieve this function when the value was changed.

     

    Best Regards,

    Larcolais Gong

     

    From: Fabio Borghi

    Sent: Tuesday, June 28, 2011 2:12 PM
    To: Xueyun Gong

    Subject: DateTimePicker BUG

     

    Here is a sample project we have used to reproduce behavior.

    Set breakpoint in MemoryBusinessEntity on set of CurrentDate property (for example here: if ((this._dtaCurrentDate != value)))

    Run sample project, you can see 27.06.2011 as Italian date format.

    -          Change the day from 27 to 1 (just press only one digit) and then press “Validate And Save” tool strip menu item; as you can see CurrentDate set property will not invoked

    Run sample project, you can see 27.06.2011 as Italian date format.

    -          Change the day from 27 to 22 (press two digit) and then press “Validate And Save” tool strip menu item; as you can see CurrentDate set property will now correctly invoked

     

    Thank you

     

    Fabio Borghi

     


    Larcolais Gong[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Tuesday, June 28, 2011 3:53 AM

All replies

  • Could you please paste the vs generated code for the businessentity
    Pratap --Mark the best replies as answers!
    Monday, June 27, 2011 2:42 PM
  • Hi,

    We have some update regarding this issue!

    We have the problem also using a simple list with manually create business entity without using LINQToEntoty or LINQTOSQL.

    I mean the issue is related to DataTimePicker control.

    Could we leave this thrad here?

    Do you suggest to post it in onother thread?

    Thank you


    FabioBo
    Monday, June 27, 2011 2:49 PM
  • Hello FabioBo,

    Thank you for posting.

    I read your post carefully, but I cannot find anything very helpful information from your description. In your latest reply, you have eliminated your question into DateTimePicker control itself. So my option is:

    1. Could you please provide more detailed code snippets and steps to us to help us reproduce your issue on our sides? You can send the project directly to me. v-xugong@microsoft.com

    If you have any finding, please feel free to let us know.

    Best Regards,

    [Mail]:

    Hello,

     

    I followed this case nowadays. Here’s my update from the product group. As I mentioned in the previous mail, this is an intentional behavior for the control. It doesn’t think there is anything to validate when the input is incomplete.

     

    Please feel free to let me know if you have any question.

    Best Regards,

    Larcolais Gong

     

    From: Xueyun Gong

    Sent: Wednesday, June 29, 2011 4:09 PM
    To: 'Fabio Borghi'
    Subject: RE: DateTimePicker BUG

     

    Hello again,

     

    After I checked your code sample, first of all, it looks that we should type at least 2 words into it and then invoked this event. We can also use ValueChanged event to achieve this function when the value was changed.

     

    Best Regards,

    Larcolais Gong

     

    From: Fabio Borghi

    Sent: Tuesday, June 28, 2011 2:12 PM
    To: Xueyun Gong

    Subject: DateTimePicker BUG

     

    Here is a sample project we have used to reproduce behavior.

    Set breakpoint in MemoryBusinessEntity on set of CurrentDate property (for example here: if ((this._dtaCurrentDate != value)))

    Run sample project, you can see 27.06.2011 as Italian date format.

    -          Change the day from 27 to 1 (just press only one digit) and then press “Validate And Save” tool strip menu item; as you can see CurrentDate set property will not invoked

    Run sample project, you can see 27.06.2011 as Italian date format.

    -          Change the day from 27 to 22 (press two digit) and then press “Validate And Save” tool strip menu item; as you can see CurrentDate set property will now correctly invoked

     

    Thank you

     

    Fabio Borghi

     


    Larcolais Gong[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Tuesday, June 28, 2011 3:53 AM
  • We have post the same issue on this thread: http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/e2f6bf92-a61f-440f-83e0-8ce3b5e7ba9d/

    Thank you

     

     


    FabioBo
    Monday, July 11, 2011 6:22 AM