How can I change the datetime and number format for a XamDataGrid without changing the CurrentCulture of the current Thread? I created an XBAP application with semi-trusted code (Local Intranet) and I want (have) to give my users a feature to switch between two Languages (English/German). When I change the Language property of a XamDataGrid nothing happens... Can anybody help me?
Hi,
I'm having a similar problem and am wondering whether the hotfix we are waiting on will fix it as well.
I want a grid to format currencies in a specified currency - not necessarily the same as either CurrentCulture or CurrentUICulture. These cells are (sometimes) editable as well (using XamCurrencyEditor). I am also using custom ValueToTextConverter and ValueToDisplayTextConverter classes, to enable empty entry to be converted to a 0 and 0 values to appear as "-" in the grid, respectively.
Setting the Language property for the grid results in the correct currency formatting being used, and I can see the correct CultureInfo being passed to me Convert() and ConvertBack() methods. However, when I edit a cell the value that is passed to ConvertBack() in my ValueToTextConverter class is a string formatted according to CurrentCulture, and therefore I get a FormatException. The code for ConvertBack is as follows:
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture){ // Get value string stringValue = value as string; // Check for zero if (string.IsNullOrEmpty(stringValue)) { return 0M; } // Parse return decimal.Parse(stringValue, NumberStyles.Currency, culture);}
Is this the same problem, and will it be solved by the same hotfix?
Thanks,
Karli
Hello Curtis,
thank you for the reply. I already read this post. This is the reason why I referred in my post to the Language Property and the Problem with the culture.
Do you have a different tipp for me?
Thank you,Jürgen
Hello Juergen,
Here is a thread ( http://forums.infragistics.com/forums/p/5856/26599.aspx#26599 ) that talks about how to change the culture for a specific instance of the XamDataGrid. However towards the bottom of the thread we mention that there are some issues with handling culture in the XamDataGrid which have been fixed but not yet made available in a hotfix. If you end up experiencing any of those issues, please let us know.
Thank you,
Curtis