Skip to main content

TcxCustomTextEditProperties.MaxLength Property

Specifies the maximum number of characters a user can enter into an editor.

Declaration

property MaxLength: Integer read; write;

Property Value

Type
Integer

Remarks

Use the MaxLength property to specify the maximum number of characters a user can enter into an editor. If this property value is 0, no limitations are applied to the length of entered text. If the number of characters already entered equals the MaxLength property value, further text input is ignored.

The default value of the MaxLength property for a data-aware editor is determined by the MaxLength attribute of the dataset field to which this editor is connected (the default value is obtained only for string fields; for other field types the default value is 0). If a user enters and posts a string whose length is greater than the default value of the MaxLength property, the string is truncated.

You can use the RestoreDefaults method to revert to default values of the MaxLength property and other properties retrieved from the related TField object attributes.

Note

The MaxLength property value does not affect the entered text by changing the Text or EditValue property.

See Also