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
1020
Need help with formatting of cell values.
posted

Hi Friends,
How do I display a value of  -77 as (77) and -77.78 as (77.78)  in the
UltraGrid cell?.  When the user enters a negative value in the cell,
he should be able to enter it, but when he removes focus from the
cell, it should be displayed as a positive value wrapped with brackets.
Also, this needs to be done particular cells. So it has to be at the cell
level.
I tried various options but it is getting too difficult to figure this out.
Kindly help,
Sid.

 

  • 469350
    Suggested Answer
    Offline posted

    Hi Sid,

    The way the Format property of a column works is that the grid simply takes the Value of the cell and calls the ToString method and passes in the format. So the formatting is really done by the DotNet framework. As such, in order to find out more about the possible formats, you need to check out the Microsoft documentation on numeric formatting.

    Here's a couple of links that should help you out.

    Custom Numeric Format Strings

    Standard Numeric Format Strings