Don't know the nomenclature of specifying the datatype.
I tried using Field.Datatype = gettype(System.Decimal) but none of the fields displayed.
Any thoughts?
Paul
Hi
Thanks for the info on setting the editor, though the issue with dollars is still confusing me - my application is running under culture "en-GB" and yet decimal values still default to being prefixed with a dollar sign. If the grid uses the current culture to define the prefix and my region settings and current culture are all set to a UK format, why am I not seeing a currency symbol for GBP (£)?
Thanks
Hi Paul,
For decimals the data presenter uses currency editor which by default displays the currency symbol of the current culture so it does pick it up from regional settings.
As for changing the editor type in C#, you can set the Field.Settings.EditorType property, something along the lines of :dataPresenter.FieldLayouts[0].Fields[0].Settings.EditorType = typeof( XamNumericEditor );
Above code sets it on the first field in the first field layout. If you have multiple field layouts or if you are rebinding the data source then you may want to hook into the FieldLayoutInitializing event and in the handler loop through the fields and set their Settings.EditorType if the field's data type is decimal.
Hope this helps,
Sandip
Is this still the case for 2010.1 that decimals are treated as dollars? Should it not be picking it up from, at the very least, regional settings?
My scenario is that I am data-binding to a DataTable object - the table content is not of fixed format so modifying the xaml is not an option - in this case can you advise me what to set in c#?
Thanks.