Ticket Q532645
Visible to All Users

XAF datetime format 'dd/MM/yyy'

created 11 years ago

I would like to have dates in "dd/MM/yyyy" format so:
I changed the EditMask and the DisplayFormat propertiesof a datetime view column in the Model.DesignedDiffs.xafml, as you can see in the attached file.
In Explorer it seem fine but in chrome it doesn't look good, The format is ' MM/dd/yyyy'.

I also tried to add it to the ORMDataModelCode:

C#
DateTime fStartDate; [Persistent(@"Start Date")] <bold> [Custom("DisplayFormat", "dd/MM/yyyy")] [Custom("EditMask", "dd/MM/yyyy")]</bold> public DateTime StartDate { get { return fStartDate; } set { SetPropertyValue<DateTime>("StartDate", ref fStartDate, value); } }

But it doesn't correct the issue in chrome.

Answers approved by DevExpress Support

created 11 years ago (modified 11 years ago)

Hello Miri,
Use the ModelDefaultAttribute instead of the Custom one for this task.
Or alternatively customize the DefaultEditMask and DefaultDisplayFormat attributes for the View Items | PropertyEditors | System.DateTime node in the Model Editor. I hope this helps.

    Show previous comments (1)
    Dennis Garavsky (DevExpress) 11 years ago

      I have just noticed that your display format string is wrong. I have attached a screenshot of the correct format to my original answer. In addition, I suggest you refer to MSDN or http://documentation.devexpress.com/#Xaf/CustomDocument2754
      for more information on formatting. I hope this helps.

        DevExpress don't just say use blah, show how to use blah. Few lines of useful sample code will not hurt you, I hope.

        Dennis Garavsky (DevExpress) 11 years ago

          @Nono: Thanks for your feedback. Please let me know if you experience any difficulties with the example attached to my original answer. If you have any further difficulties with this task, please create a separate ticket in the Support Center so we can help you.

          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.