I have spent the majority of my day trying to figure out how to format the decimal fields in my DataGrid so that they are not formatted as currency.
I've run into two problems trying to use the forum as a resource to find the answers I'm looking for...
1) Most of the other posts referring to the same issue have links referring to a solution, but the links are dead or..
2) The answer lies in using 'XamNumericEditor' to change the default behavior. In all of these examples, 'igEditors' is used as the type defined as the namespace - but what Namespace?? This is never shown and I have not been able to successfully define it.
My grid is embedded in a user control :
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:igDP="http://infragistics.com/DataPresenter"
x:Class="QCP_SiteMgr.InventoryDisplay"
x:Name="UserControl"
d:DesignWidth="640" d:DesignHeight="480">
Can anyone help me with the proper references?
Hello,
This is the namespace for the Editors:
xmlns:igEditors="http://infragistics.com/Editors".
Another way would be to set the ValueType property of the XamCurrencyEditor to Double, like this:
<igEditors:XamCurrencyEditor ValueType="{x:Type sys:Double}" />
where the sys is the following namespace:
Ok, a couple more hours of digging and I think I found what I needed. In brief:
xmlns:igEditors="http://infragistics.com/Editors" >
...
<igDP:XamDataGrid.FieldLayouts>
<igDP:FieldLayout>
<igDP:FieldLayout.Fields>
<igDP:Field Name="Weight" Row="1" Column="4" Width="79">
<igDP:Field.Settings>
<igDP:FieldSettings EditorType="{x:Type igEditors:XamNumericEditor}" EditAsType="{x:Type sys:Double}"/>
</igDP:Field.Settings>
</igDP:Field>
</igDP:FieldLayout.Fields>
</igDP:FieldLayout>
</igDP::XamDataGrid.FieldLayouts>
</UserControl>
It never ceases to amaze me that what you expect to be a simple issue - too often takes forever to solve and what you expect to be complicated and difficult often only takes minutes...
Thanks for your help.
Can you walk me through this, I'm now having trouble finding the necessary code in the forums.
I have serveral decimal columns in my grid. Only one of them should be currency (btw, when there could be all kinds of formats one might want to apply to a decimal - what was the reasoning to have it default to currency?) - so I don't want to make a global change to the currencyeditor.
I'm assuming I'll have to fix this in the FieldSettings on a field by field basis. Could you give me the syntax for that?
Thank you for your help.