DateTime is incorrectly formatted

2 posts, 0 answers
  1. Kristoffer
    Kristoffer avatar
    158 posts
    Member since:
    Dec 2012

    Posted 12 Feb 2013 Link to this post

    My regional settings in Windows show that date should be formatted as follows:
    'den 'd MMMM yyyy

    Now, when I show a DateTime in you RadPropertyGrid, I get this weird format:
    item.Value == "2013-02-12 14:46:39"
    item.FormattedValue == "2-12-2013 2:46 "

    FormattedValue is shown in the UI (I haven't set the CultureInfo in my app, and all my resources are marked as Neutral). To me, this looks like some non-standard format string.
    1) It doesn't use my system's locale.
    2) The time has no "PM" suffix.
    3) The string has a trailing space.

    What's going on? Why doesn't the formatter respect my settings?
  2. Ivan Petrov
    Ivan Petrov avatar
    717 posts

    Posted 15 Feb 2013 Link to this post

    Hello Kristoffer,

    Thank you for writing.

    RadPropertyGrid uses the CurrentUICulture to convert different data types to a string representation. This though is not the correct way for the job. It should use CurrentCulture. I have logged this issue in our Public Issue Tracking System - PITS. You can track its progress, subscribe for status changes and add your vote/comment on the following link - PITS Issue. Until the issue is resolved you can workaround it by setting the CurrentUICulture of your application explicitly.

    I have also updated your Telerik points for bringing this issue to our attention.

    I hope this will be useful. Should you have further questions, I would be glad to help.

    All the best,
    Ivan Petrov
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Back to Top