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
1500
Currency format for selected non-numeric cell value
posted

Hi all,

I'm using a custom type for cells values of the grid (say CustomCell). When the grid is rendered it calls the CustomCell.ToString() method. So, the only thing I need is to override the ToString method of the CustomCell class. The CustomCell objects represent only numeric values.

Now we have a requirement to show some cells of the same column in a currency format ("$nnn.nn")  and some cells still in a "regular" format. That would be logically to set for some cells the Currency style. However, this will not work, because I'm not using numeric values as cells values.

 Is there a simple way some cells of the same column can be in the currency format while other ones in "regular"? I would like to change the CustomCell only by implementing IFormattable.

 Thanks,

Vitaly

 

Parents Reply Children