Databinding to type double - decimal mark lost

Posted by user1277327 on Stack Overflow See other posts from Stack Overflow or by user1277327
Published on 2012-04-01T23:21:24Z Indexed on 2012/04/01 23:29 UTC
Read the original article Hit count: 308

Filed under:
|
|
|

I have a project where I'm databinding a gridview to a list, where one column is databound to a gridview. The problem I have is that with the double being 5.5 on one computer it appears as 5.5 in the gridview. But on another it looks like 55, the decimal mark dissapears. So 3.14 will look like 314 etc.

The error occurs with the following code:

myDatagrid.ItemsSource = someList;
Binding binding = new Binding("DoubleValue");
myColumnInDatagrid.Binding = binding;

I've also tried using a very simple valueconverter, that just return the double, and parsed it in ConvertBack. I'm pretty new to WPF so I'm sorry if I've made some obvious mistakes, I just don't understand why it works on one computer but not on the other. Perhaps it should be noted that both of the computers use the same operating system, with the same language settings (afaik at least).

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET