I'm having a problem with the XamDataGrid displaying dates.
By default, it displays a date in mm/dd/yyyy format. I've tried changing the format property of the texteditor for the cell, but when I set it to "dd/mm/yyyy" for some reason, the month part of the date is completely wrong. I'm getting 19/02/2009 displayed as 19/37/2009 and 19/00/200, and I can't see why this is happening. Is it a bug with the datapresenter, or am I missing a setting somewhere.
I've tried setting explicitly setting the CurrentUICulture to "en-GB" but this makes no difference. I've tried using the mask property but is doesn't help.
Checking the System.Globalization.CultureInfo, it says that the InstalledUICulture is still set to en-US, but searching around seems to suggest this is irrelevant. Is the datagrid using this setting, and even if it is, is there anyway to get it displaying the month correctly?
Hello,
It works fine for me when I set the Mask property of the XamDateTimeEditor with a style like this (for all my editors) :
<Style TargetType="{x:Type editors:XamDateTimeEditor}"> <Setter Property="Mask" Value="dd:mm:yyyy"/> </Style>
and here is a screenshot of the result :
Hope this Helps.
Alex.
I tried with "/", too and it works like expected -- correctly.
If you still have this problem attach some sample project.
Hi Alex,
I managed to get the mask working with a specific format, but the problem then was that the format wouldn't change with the UICulture settings. Having set the language of the grid to the CurrentUICulture on startup I'm now getting the desired results, I was just a little surprised that the language didn't automatically follow UICulture by default.
Cheers,
Rob
Hello Rob,
You are right, I am experiencing the same problems with the culture and can't seem to see the problem.
If you think that is a bug is best to contact our Developer Support department directly - they can be reached athttp://ko.infragistics.com/support/Thanks.
Will do :)
Cheers!
The Language property is actually a property of the WPF FrameworkElement. I agree that it probably should default based on the CurrentCulture but that is not something that we have control over. The Language property is used by the WPF framework to determine the Culture it passes to bindings, etc. There are posts/blogs that have discussed this issue. One that discusses a more global workaround can be found here.