Home Forums WinForms controls Xceed Grid for WinForms How to format floating point data?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #13091 |

    If my grid cells values are doubles how can I control the formatting? I.e. I want to round 1234.56789 to 1234.57.

    -dh

    Imported from legacy forums. Posted by dahoffer (had 2443 views)

    Xceed Support
    Member
    Post count: 5658

    Hi dh,

    Here is what I would do (keep in mind that I have not actually tried this myself!).

    1- Assign the GridNumericTextBox editor to the column (or cells) that you want to format.

    2- Set the <a href=”http://doc.xceedsoft.com/products/gridNet/ref/xceed.grid.editors.gridnumerictextbox.formatspecifier.html”>FormatSpecifier</a&gt; property of the GridNumericTextBox. This topic in msdn (ms-help://MS.VSCC/MS.MSDNQTR.2003JUL.1033/cpguide/html/cpconcustomnumericformatstrings.htm) might help.

    3- You also probably need to set the <a href=”http://doc.xceedsoft.com/products/gridNet/ref/xceed.grid.editors.gridnumerictextbox.formatprovider.html”>FormatProvider</a&gt; to a NumberFormatInfo.

    4- Set the FormatSpecifier and FormatProvider properties of the column you want to format (or the cells) to the same values as those of the GridNumericTextBox so that when the cells are not being edited, they will also be formatted.

    Again, I did not actaully try this myself so if you have any problems I would suggest that you contact technical support (support@xceedsoft.com)

    Imported from legacy forums. Posted by Jenny [Xceed] (had 399 views)

    User (Old forums)
    Member
    Post count: 23064

    I tried this, but, the formatting didn’t take affect.
    Is there an example of how to format a column value in say a currency format?

    Thanks.

    John

    Imported from legacy forums. Posted by DBAJAM (had 3640 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.