C1TextBox: Value can be assigned string in Validated event > MaxLength

Posted by: pauld on 12 May 2022, 6:03 am EST

    • Post Options:
    • Link

    Posted 12 May 2022, 6:03 am EST

    Out UI controls are version 4.0.20191.359 (as shown in winforms solution references).

    The textbox in question has MaxLength set to 11.

    We have a handler for the Validated event.

    In the Validated event, we insert some extra formatting characters into the string before assigning the string into the textbox Value property.

    The Value allows a string length greater than the MaxLength of the control.

    Shouldn’t the textbox disallow that?

    – Paul

  • Posted 12 May 2022, 8:02 pm EST

    Hi Paul,

    This is the designed behavior of the C1TextBox. The MaxLength property gets or sets the maximum number of characters the user can type or paste into the control. It does not restrict the number of characters assigned to the Text/Value property through code.

    Although, we observed that the description of the MaxLength property is a bit confusing. We have escalated it to the development team for enhancement. We will let you know as soon as we have an update.

    [C1WIN-27361]

    Kind Regards,

    Kartik

  • Posted 13 May 2022, 2:32 am EST

    Kartik,

    Thanks for the quick response and the information.

    – Paul

  • Posted 23 March 2023, 11:36 pm EST

    Hi Paul,

    The description of the MaxLength property has been updated to “Gets or sets the maximum number of characters the user can type or paste into the textbox control” in the latest 2023v1(596) release. The latest packages are already available on NuGet and will be available for installation from ComponentOne Control Panel in a few days.

    (https://www.nuget.org/packages/C1.Win.C1Input/4.8.20231.596)

    Best Regards,

    Kartik

Need extra support?

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

Learn More

Forum Channels