Bug Report T288114
Visible to All Users

ASPxGridView - GridViewDataDateColumn returns a date string to the default format when editing in Batch mode

created 9 years ago (modified 9 years ago)

I have a grid in a complex page that exhibits the same behavior in your example. Please use it as a reference.

https://www.devexpress.com/Support/Center/Example/Details/T171182

The problem is not related to validation. To reproduce the problem change the short date format to something other that "m/d/yyyy".

If you try this with your example the grid initially shows the dates in the short date format as I want it to. However when you edit the date it changes it to "m/d/yyyy" and leaves it that way.

This is illustrated in the attachment. What do I need to do to keep the date displayed consistent and also have it pick up the format from the short date setting? Note that I will also be manipulating the values client side within the "OnBatchStartEdit" handler.

Thanks

Answers approved by DevExpress Support

created 9 years ago

We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

    created 9 years ago

    Hello,
    As far as I understand, you set your own DateEditProperties.DisplayFormatString which varies from the default format value "d". However, I did not manage to reproduce the behavior, when the date string returns back to the default format after cell has been edited (see the attached screencast). You can see that the input of ASPxDateEdit still has the default format, but one can overcome this, if specifying the DateEditProperties.EditFormatString property the same way as the DisplayFormatString. For example:

    ASPx
    <dx:GridViewDataDateColumn FieldName="BirthDate" VisibleIndex="5"> <PropertiesDateEdit DisplayFormatString="dd-MMM-yyyy" EditFormatString="dd-MMM-yyyy"> </PropertiesDateEdit> </dx:GridViewDataDateColumn>

    If you have more questions, I will be happy to help you.

      Comments (2)

        That isn't what I am doing. All I do is set my short date in the operating system on my local machine to a format other than "m/d/yyyy". For example "dd-MMM-yyyy". Then I download your sample referenced above and run it locally.  I am not manipulating  the example in any way. It shows the dates in the grid as the short date format. When I edit it switches to "m/d/yyyy" and never switches back when I leave the cell. I would be happy if it would just consistently use the short date format automatically for both editing and display without hard coding a particular format.

        Nastya (DevExpress Support) 9 years ago

          Hi,
          Thank you for the additional information. Having followed the steps you described, I managed to reproduce the issue. I forwarded this ticket to our developers for further research. We will inform you as soon as we have any results.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.