This is a migrated thread and some comments may be shown as answers.

DateTime is incorrectly formatted

1 Answer 116 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Kristoffer
Top achievements
Rank 1
Kristoffer asked on 12 Feb 2013, 02:41 PM
My regional settings in Windows show that date should be formatted as follows:
yyyy-MM-dd
'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?

1 Answer, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 15 Feb 2013, 11:14 AM
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.
Tags
PropertyGrid
Asked by
Kristoffer
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Share this question
or