Might be quite a simple question, I have bound a XamDataGrid to a SQL Server view, one field is a quantity, stored as a decimal in the DB. When the Grid displays it, its default format is to show this decimal value as currency, but we only need it to show a decimal value without leading currency symbol.
Having spent all day in FieldLayouts, FieldLayoutSettings and FieldSettings I'm still none the wiser.
Any help greatly appreciated, thanks!
myField.Settings.EditorType = typeof(XamMaskedEditor);
Style style = new Style(typeof(XamMaskedEditor));
style.Setters.Add(new Setter(XamMaskedEditor.MaskProperty, "9999"));
myField.Settings.EditorStyle = style;
"richstokoe" wrote in message news:14736@forums.infragistics.com... That's what I'm trying to figure out now. Unfortunately parts of the API reference are down, notably the design and style sections; I keep getting 404 errors. The problem as I see it (without being able to reference the documentation) is I can happily assign: myField.Settings.EditorType = typeof(Infragistics.Windows.Editors.XamMaskedEditor) ; but this doesn't allow me to set the mask. The default display of a decimal should never be 'as a currency', I can't figure out why this is the case. You shouldn't have to build your own custom field editors just to get an unformatted number... Our product uses multiple currencies also, and the decimal fields default to the client locale's currency symbol and this is, in many cases, making the data displayed simply wrong.£1 != $1. Can anybody offer suggestions on how to format numbers properly? I'm sure I'm missing something conceptually very simple, but the lack of docs is causing big problems. Many thanks. http://forums.infragistics.com/forums/p/2187/14736.aspx#14736
That's what I'm trying to figure out now. Unfortunately parts of the API reference are down, notably the design and style sections; I keep getting 404 errors.
The problem as I see it (without being able to reference the documentation) is I can happily assign:
myField.Settings.EditorType = typeof(Infragistics.Windows.Editors.XamMaskedEditor) ;
but this doesn't allow me to set the mask.
The default display of a decimal should never be 'as a currency', I can't figure out why this is the case. You shouldn't have to build your own custom field editors just to get an unformatted number... Our product uses multiple currencies also, and the decimal fields default to the client locale's currency symbol and this is, in many cases, making the data displayed simply wrong.£1 != $1.
Can anybody offer suggestions on how to format numbers properly? I'm sure I'm missing something conceptually very simple, but the lack of docs is causing big problems.
Many thanks.
The default display of a decimal should never be 'as a currency', I can't figure out why this is the case. You shouldn't have to build your own custom field editors just to get an unformatted number... Our product uses multiple currencies also, and the decimal fields default to the client locale's currency symbol and this is, in many cases, making the data displayed simply wrong.£1 != $1.
Did you apply any masking or formating to the cell, after setting it to a XamTextEditor?
If so, how did you do it to make it still display as a number, ex. 1,000.00 ...etc.
Thanks
DK
I have resolved this issue now:
myField.Settings.EditorType = typeof(Infragistics.Windows.Editors.XamTextEditor);
I had been overlooking the Editxxxxxxx properties as I thought they would be only used when the field/cell was being edited.
I should probably add that this:
myField.DataType = typeof(decimal);
still gives the currency-formatted version.
myField.DataType = typeof(string);
actually prevents ANYTHING from loading, i.e. we get an empty datagrid.