I have a column with the format string set to currency. When the cell goes into edit mode it shows a total of 4 decimal places instead of 2. What is the easiest way to format the value in edit mode so that it will show only 2 decimal places? Thanks.
That did the trick. Thanks for your time.
Hi,
So the easiest way is to apply a ValueConverter to the EditorValueConverter of the Column:
public class MyEVC : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return String.Format(culture,"{0:c}", value); } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return value; } }
<ig:XamGrid.Columns> <ig:TextColumn Key="ChapterNumber" FormatString="{}{0:c}" EditorValueConverter="{StaticResource evc}"/> </ig:XamGrid.Columns>
Hope this helps,
-SteveZ