RepositoryItemTextEdit.MaxLength Property

Gets or sets the maximum number of characters an end-user can enter into the editor.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v20.1.dll

Declaration

[DXCategory("Behavior")]
[DefaultValue(0)]
public virtual int MaxLength { get; set; }
<DXCategory("Behavior")>
<DefaultValue(0)>
Public Overridable Property MaxLength As Integer

Property Value

Type Default Description
Int32

0

A positive integer specifying the maximum number of characters end-users can enter. 0 to disable the text length limit.

Remarks

End-users cannot enter strings whose length exceeds the specified limit. Attempts to do so will have no effect. Note: you can still assign values of any length via code. If the text length exceeds the specified limit, end-users are only allowed to delete characters while the number of characters is not less than the MaxLength's property value.

In masked mode, the MaxLength property is supported if an editor's EditValue is of the string type. Otherwise, the MaxLength property must be kept in its default value. In this case, the number of characters an end-user can enter is specified by the editor's mask. Use the MaskProperties.EditMask property to define the mask and mask options.

See Also