Skip to main content

BaseEdit Class

Serves as the base for all editors that can be used as standalone editors and for in-place editing in container controls (e.g., within the GridControl).

Namespace: DevExpress.Xpf.Editors

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

NuGet Package: DevExpress.Wpf.Core

Declaration

[DefaultBindingProperty("EditValue")]
public abstract class BaseEdit :
    Control,
    IBaseEdit,
    IInputElement,
    ISupportDXValidation,
    IExportSettings,
    ILogicalOwner

The following members return BaseEdit objects:

Remarks

The BaseEdit abstract class implements basic functionality for editors that can be used as standalone editors and for in-place editing in container controls (GridControl, TreeListControl, etc.).

Note

The BaseEdit class does not implement any editor-specific functionality. If you want to create a custom editor that has no features in common with any existing editor, the custom editor should inherit from the BaseEdit class.

To use a custom editor within a data aware control (GridControl, TreeListControl, etc.), implement a ColumnBase.CellTemplate.

Editor Value

The EditValue property contains an editor’s current value which is valid. If an end user has entered an invalid value, it is not posted to EditValue until it is corrected.

The EditValueChanging event is raised when the editor’s value is about to be changed (a user types or deletes a character, chooses a value from a drop-down list, etc.).

The BaseEdit.EditValueChanged event occurs after the edit value has been validated and changed.

Tip

The Obtaining Editor Values section describes how to obtain editor value, and how to synchronize values between an editor and its bound source.

Useful API

Display Value

The text displayed within the editor depends on the EditValue property and EditValueType. Use the DisplayFormatString property to format the text value (for example, to display a currency amount).

<Window ...
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
        xmlns:sys="clr-namespace:System;assembly=mscorlib">
    <Grid>
        <dxe:TextEdit DisplayFormatString="c">
            <dxe:TextEdit.EditValue>
                <sys:Double>1232</sys:Double>
            </dxe:TextEdit.EditValue>
        </dxe:TextEdit>
    </Grid>
</Window>

The image below illustrates the result.

You can display a custom text within the editor by handling the CustomDisplayText event.

The DisplayText property returns the string currently displayed within the editor.

Validation

Refer to the Input Validation documentation section for information on how to validate end-user input.

Useful API

Null Value and Null Text

The TextEditBase class descendants can display a prompt text (NullText) when the editor’s value is null.

The NullValue property allows you to specify a null value for TextEdit-derived editors, in addition to null value.

Use the BaseEdit.ShowNullText property to control the Null Text visibility.

<dxe:PasswordBoxEdit NullValue="" NullText="Please enter your password..." />

PasswordBox_NullText

Useful API

See Also