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
180
WinGrid Currency Format
posted

Normally I would just use the "c" format to show currency values; however, in this app one record could be in US Dollars, the next in Brittish Sterling, the next in Mexico Dollars, etc...

I could leave off the $ amount in the format and just use #,###.00 which didn't work for me

or 

Is there an easy way to format each row for a specific currency?

  • 469350
    Suggested Answer
    Offline posted

    Here's a little sample I whipped up to do this kind of thing. 

     

     

    WinGrid - Different Formats in the Same Column CS.zip
  • 69832
    Suggested Answer
    Offline posted

    UltraGridCell exposes an EditorControl property (replaced by EditorComponent in 2009.2) to which you can assign an Infragistics.Win.UltraWinEditors.UltraCurrencyEditor. For each culture you want to support, set the FormatProvider property to that culture, then assign that UltraCurrencyEditor to the cell's EditorControl/EditorComponent property. You also have to make sure the associated column's FormatProvider property and Format property are left unset because they override the editor's format provider.