Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1540
Decimal field of object always appears as a currency when bound to XamDataPresenter
posted

I am binding an object to a XamDataPresenter and one of the properties is of decimal type.  At run-time, it displays with commas separating the thousands and a dollar in front of the value.  How do I stop this?

I tried explicitly defining the field, but this didn't help:

<igData:XamDataPresenter Name="dpMyData" DataSource="{Binding}">
  <igData:XamDataPresenter.FieldLayoutSettings>
    <igData:FieldLayoutSettings AutoGenerateFields="False" />
  </igData:XamDataPresenter.FieldLayoutSettings>
  <igData:XamDataPresenter.FieldLayouts>
    <igData:FieldLayout>
      <igData:FieldLayout.Fields>
        <igData:Field Name="MyField" DataType="{x:Type sys:Decimal}" />
      </igData:FieldLayout.Fields>
    </igData:FieldLayout>
  </igData:XamDataPresenter.FieldLayouts>
</igData:XamDataPresenter>

Parents
No Data
Reply
  • 69686
    posted

    Hello,

    This is because the default XamEditor for fields of type decimal is XamCurrencyEditor and this is the reason of the currency symbol and the commas.

    To void that you have to register new XamEditor for this field. Here is a thread in the forum that I answered a similar question.

    http://forums.infragistics.com/forums/p/20591/74287.aspx#74287

    Hope this helps

    Alex. 

Children