DomainDataSource or Datamodel returns Decimal with wrong Culture, "." instead of ","?


  • Hello,

    the Silverlight App uses the de-DE Culture, which i checked using the Debugger but when i Load Decimal Values of an Entity they are formatted in a different Culture. It should be "," for the Comma but instead i receive "." ?
    If i view the SQL Table the Decimal Values are shown like 123,83 which is right. In my DataGrid it is 123.83.

    Do i have to set the Culture somewhere in my DataModel or DomainDataSource?


    Monday, April 06, 2009 9:28 AM

All replies

  • DataGrid is not a part of .Net RIA services, but rather Silverlight Toolkit. If you post in the toolkit forum located at, somebody will help you.

    Monday, April 06, 2009 1:38 PM
  • I get the 123.45 from the DomainDataSource and then my Entites contain values with "." instead of "," .
    So it should not be the DataGrid which causes this.

    Monday, April 06, 2009 1:56 PM
  • You can try setting the culture in the webproject, by changing (or adding) the lobalization element in the web.config.

    <globalization uiCulture="de-DE" culture="de-DE" />

    Besides that are you using typed data (decimals in this case) that's transferred from the DomainDataSource to the Silverlight application? Or are you transferring everything as strings.
    Monday, April 06, 2009 2:32 PM
  • thanks for your answer, however adding the globalization line to the web.conf doesn't seem to have an effect on the . in decimal values.

    No  - not strings, it is typed Data.

    Tuesday, April 07, 2009 5:55 AM
  • try this code, dg1 is DataGrid

    dg1.Language = System.Windows.Markup.XmlLanguage.GetLanguage("de-DE");

    Friday, April 10, 2009 1:30 AM
  • also changing the DataGrid Language didn't change anything. I helped myself with a IValueConverter for the decimals, but now i have anonther problem with DateTime Values which are off by 2 hours.

    In my SQL Tabele: 17.04.2009 00:00 and from my DomainDataSource i get 16.04.2009 22.00 PM ... how can that be?

    (de-DE is also set in the web.conf)

    Friday, April 17, 2009 7:20 AM