Skip to main content

TextEditBase Class

Serves as the base class for editors that have the text edit capability (e.g. TextEdit, ComboBoxEdit, DateEdit).

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v22.2.dll

NuGet Package: DevExpress.Wpf.Core


public abstract class TextEditBase :


The TextEditBase is the abstract class that implements basic functionality for editors that have the text edit capability.


The TextEditBase class inherits its features from the BaseEdit class.

Refer to the BaseEdit class description for information on derived features and API.

Editor Value

The Text property contains the text displayed within the editor. To get the currently displayed text (while the end user types), use the EditText property.

You can limit the maximum number of characters an end user can enter into the editor using the MaxLength property.

Useful API

Text Operations

The TextEditBase class has the following methods for text operations:

Text Selection

Set the SelectAllOnGotFocus property to true to enable automatic text selection when the Tab key is pressed to focus the editor. To enable text selection when a mouse click focuses the editor, set the SelectAllOnMouseUp to true.

To select all text within the editor manually, use the SelectAll method. To select only the specified amount of text, use the TextEdit.Select(System.Int32,System.Int32) method.

Trimming and Wrapping

An editor’s text content is trimmed when it exceeds the editor’s edges in display mode. Use the TextTrimming property to change this behavior. The TextTrimming property has no effect unless the TextEditBase.TextWrapping property is set to NoWrap.

If text wrap is enabled, the text editor can display multiple text lines. The LineCount property gets the total number of text lines.

Useful API

Appearance Customization

Refer to the following topic for more information: Appearance Customization.

See Also