Hi,
I am assigning a datatable to xamdatagrid's datasource. the datatable contains decimal numbers (both positive and negative). unfortunately, the negative numbers are shown as blank. I guess I made some format on top of the data (for removing $ symbol before the numbers), and this could be the reason. Below is the code that prevents the $ symbol to be shown.
Infragistics.Windows.Editors.
);
Can anyone help me how to show negative numbers by keeping this format?
Thanks in advance.
Ganesh.
Hello Ganesh,
This is probably because you are using a XamTextEditor for displaying decimal values. If you do this only to remove the currency sign, you can try XamNumericEditor instead of XamTextEditor. You can however, also remove that by registering default mask for the XamCurrencyEditor like this:
XamCurrencyEditor.RegisterDefaultMaskForType(typeof(decimal), "nnnnn.nn");
Hi Alex,
Thanks for the reply. Yes I have placed the mask and is working fine now.
Thanks,
Ganesh
How can I keep the currency formattng for a negative number?
I'd like to get parens around the number if it is negative. So that -123.88 appears as $(128.88)
Hello,
I believe this is the same issue here
This doesn't work for me. This concept of styling a value in a cell is difficult to understand. There are
I have this XAML and the data is a double but the formatted value is weird. A negative double value doesn't show up at all, a poitive double value shows up as a really weird value such as $134,940.00;($9,000)
<igDP:Field Name="Col5" Label="BASE YEAR BUDGET"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="False" EditorType="{x:Type igEditors:XamCurrencyEditor}"> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamCurrencyEditor}" > <Setter Property="Mask" Value="$###,##0.00;($###,##0.00)" /> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field>
Strangley, if I use this XAML:
<igDP:Field Name="Col6" Label="FUNDING"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="False" EditAsType="{x:Type sys:Decimal}"/> </igDP:Field.Settings> </igDP:Field>
The field displays almost as I want it. It shows as a currency value $123.00 or -$123.00.
Why would setting the EditAsType affect the display of a readonly field? Shouldn't there be a property named DisplayAsType or something like that?
I figured it out. I needed to set the Format and not the Mask in the setter.