Bad format using DataFormatString="{0:#,##0}" in C1GridView 2025v2 399

Posted by: enrique.pv-ext on 17 April 2026, 6:30 am EST

  • Posted 17 April 2026, 6:30 am EST

    Hi,

    Migrate from 2010v1 to 2025v2 399 in ASP.NET WebForms NET Framework 4.8.1.

    Using C1GridView from C1.Web.Wijmo.Controls.48.dll

    DataFormatString="{0:#,##0}"

    My markup code:

    
     <Columns>
         <cc1:C1BoundField DataField="MonthNumber" SortExpression="MonthNumber">
             <ItemStyle CssClass="GridText" />
         </cc1:C1BoundField>
         <cc1:C1BoundField DataFormatString="{0:#,##0}" HeaderText="I" DataField="I" SortExpression="I" >
         <ItemStyle CssClass="GridNumber" Width="80px" />
         </cc1:C1BoundField>

    Any suggestions ?

  • Posted 20 April 2026, 3:06 am EST

    Hello Enrique,

    In newer versions, the wijmo based grid uses client-side (JavaScript) using Globalize, not server-side .NET string.Format.

    Instead of using “{0:#,##0}” format, please use “n0”.

    We have created a sample with correct implementation: GridView_Sample.zip

    Regards,

    Uttkarsh.

  • Posted 20 April 2026, 3:48 am EST

    Working too using

    DataFormatString="c2"
    ?

  • Posted 20 April 2026, 7:36 am EST

    Hello Enrique,

    The “n0” is Number format (no decimals) whereas “c2” is Currency format (2 decimals). [numbers in format strings such as ‘0’ and ‘2’ represents numbers after decimal]

    If your column represents currency, you can use “c2”; however, if the column represents numbers, please use “n0”.

    Regards,

    Uttkarsh.

  • Posted 24 April 2026, 6:04 am EST

    alternatives for

    DataFormatString="{0:###,0}" 

    n0 ?

    DataFormatString="{0:#,##0}"

    c2 ?

  • Posted 24 April 2026, 8:56 am EST

    Hello Enrique,

    Both .NET format strings “{0:#,##0}” (number with thousand separators, no decimals) and “{0:###,0}” (grouped number, no decimals with a looser pattern) should be replaced with “n0”.

    This is the appropriate equivalent in the newer JavaScript-based Wijmo implementation used by C1 WebForms controls.

    Regards,

    Uttkarsh.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels