C1TextBox Percent Entry Bug (v. 8.0.20242.700 - .NET 9.0)

Posted by: abraham on 19 May 2025, 2:05 pm EST

    • Post Options:
    • Link

    Posted 19 May 2025, 2:05 pm EST

    C1TextBox Percent Entry Bug.2025-05-19.zip

    The C1TextBox control has a bug where it doesn’t properly honour the CustomFormat setting for ‘P0’ (which means Percentage which zero decimal places). The control does display an existing value properly, but interprets any value entered as a literal decimal (so ‘20’ becomes ‘2000 %’). This used to work correctly in the .NET 4.8 version of this control.

    The attached VS 2022 solution demoes the problem and contains instructions on how to replicate.

  • Posted 20 May 2025, 11:35 am EST

    Hi,

    Thank you for sharing the details. We were able to reproduce the behavior you described when using a custom format like “P0”. However, the built-in percentage format (C1TextBox.FormatType = FormatType.Percent) works as before.

    We have shared our observations with the development team to get their insights and will update you as soon as we hear back.

    [Internal Tracking ID: C1WIN-34057]

    Best Regards,

    Kartik

  • Posted 21 May 2025, 1:09 am EST

    Yes, but the [C1TextBox.FormatType = FormatType.Percent] automatically uses/displays two decimal places which is undesirable in our scenario. The documentation says the CustomFormat property supports the regular .NET format string capabilities (which it did in the .NET 4.8 version of C1TextBox) so it’s a bug.

  • Posted 27 May 2025, 12:34 am EST

    Hi,

    Apologies for the delayed response.

    According to the development team, this custom percentage logic is built into the C1NumericEdit control. In .NET Framework 4.8, the C1TextBox included this logic because C1NumericEdit was derived from it. However, in .NET 6+, the implementations have been separated. Currently,

    • C1NumericEdit includes custom handling for percentages (e.g. entering 20 results in 20%).

    • C1TextBox uses the default .NET string.Format logic (e.g. entering 20 results in 2000%).

    Therefore, the development team recommends using C1NumericEdit instead of C1TextBox for your use case. Please refer to the updated sample project for reference - Sample.NET8.Updated.zip

    Best Regards,

    Kartik

  • Posted 27 May 2025, 3:50 am EST

    Thanks, we can work with that. It would be good to update the documentation for C1TextBox to highlight this recommendation and behaviour and and to explicitly state that the C1TextBox.CustomFormat property can be used for the display of e.g. any .NET format string, but not all entry formats.

Need extra support?

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

Learn More

Forum Channels