BaseEdit.EditValue Property

Gets or sets the editor's value. This is a dependency property.

Namespace: DevExpress.Xpf.Editors

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

Declaration

public object EditValue { get; set; }
Public Property EditValue As Object

Property Value

Type Description
Object

An object that is the editor's value.

Remarks

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.

By default, each time the EditValue property's value is changed, the following events are raised:

  • BaseEdit.Validate - This event is raised before the editor's value is changed, and enables you to specify whether the editor's value is valid, and whether the editor is allowed to lose focus. To disable validation, set the BaseEdit.CausesValidation property to false.
  • BaseEdit.EditValueChanged - Occurs after the edit value has been validated and changed. For instance, when an end-user types within a TextEdit, this event is raised each time the text is changed.

If the BaseEdit.ValidateOnTextInput property is set to false, the text entered by the end-user is posted to the EditValue after the ENTER key has been pressed or the editor has lost focus. To obtain the text entered by the end-user, do the following:

private void Window_Loaded(object sender, RoutedEventArgs e) {
    ((TextBox)textedit1.EditCore).AddHandler(TextBox.TextInputEvent, 
        new TextCompositionEventHandler(MainWindow_PreviewTextInput), true);
}

void MainWindow_PreviewTextInput(object sender, TextCompositionEventArgs e) {
    textblock1.Text = ((TextBox)textedit1.EditCore).Text;
}
NOTE

When using a range track bar (TrackBarEdit), allowing a range of values to be specified, use its TrackBarEdit.SelectionStart and TrackBarEdit.SelectionEnd properties to specify the range. The editor's BaseEdit.EditValue property returns a TrackBarEditRange object.

NOTE

For the SpinEdit:

If you try to set the BaseEdit.EditValue property to a new value that exceeds the SpinEdit.MinValue and SpinEdit.MaxValue range, the BaseEdit.EditValue property will store the last valid value.

Implements

DevExpress.Xpf.Editors.IBaseEdit.EditValue
See Also