Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[DefaultValue(0)]
[DXCategory("Behavior")]
public virtual int MaxLength { get; set; }

#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