Show formatted number using DataFormatString of GridViewDataColumn

3 posts, 0 answers
  1. Nagisa
    Nagisa avatar
    14 posts
    Member since:
    Nov 2011

    Posted 20 Dec 2011 Link to this post

    Hi

    I have a problem with  formatting number shown in GridViewDataColumn.
    I want to show a number like "#.##########"("{}{0:N10}") with zero at right of decimal trimmed.

    for example:
    A value of "12.12345678912"  should be shown as "12.1234567891".
    But a value of "12.12345678000"  should be shown as "12.12345678".

    Is there any way to resolve the  problem by setting DataFormatString ? or should I resolve it by other way like handling TextChanged event.

    Best Regards 


  2. Nagisa
    Nagisa avatar
    14 posts
    Member since:
    Nov 2011

    Posted 21 Dec 2011 Link to this post

    I've resolved it with setting format string with "{}{0:###,###.##########}".

    Is there any reference about  syntax of format string?

    Best Regards
  3. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 21 Dec 2011 Link to this post

    Hi Nagisa,

    You can run through this article for standard numeric format string and this one for custom numeric format string
    Let me know in case you need any further assistance.

    Regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top