wpf-devexpress-dot-xpf-dot-editors-dot-baseedit-f09cf1c6.md
Gets or sets the editor’s value. This is a dependency property.
Namespace : DevExpress.Xpf.Editors
Assembly : DevExpress.Xpf.Core.v25.2.dll
NuGet Package : DevExpress.Wpf.Core
public object EditValue { get; set; }
Public Property EditValue As Object
| Type | Description |
|---|---|
| Object |
An object that is the editor’s 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.
By default, each time the EditValue property’s value is changed, the following events are raised:
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.
The following code snippets (auto-collected from DevExpress Examples) contain references to the EditValue property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
<dxlc:LayoutItem AddColonToLabel="True" Label="First Name">
<dxe:TextEdit EditValue="{Binding Path=FirstName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" />
</dxlc:LayoutItem>
wpf-data-grid-implement-crud-operations/CS/CodeBehind/EFCore/ServerMode/IssueDetailView.xaml#L12
<dxlc:LayoutItem Label="User">
<dxe:ComboBoxEdit EditValue="{Binding Item.UserId}" ItemsSource="{Binding EditOperationContext.Users}"
ValueMember="Id" DisplayMember="Name"
reporting-wpf-print-listview-data/CS/Window1.xaml#L54
</Grid.ColumnDefinitions>
<dxe:TextEdit Grid.Row="0" Grid.Column="0" EditValue="GUID" Style="{StaticResource headerTextStyle}" />
<dxe:TextEdit Grid.Row="0" Grid.Column="1" EditValue="Date" Style="{StaticResource headerTextStyle}" />
wpf-svgimagesource-extension-specify-vector-image-as-glyph/CS/DXSample/MainWindow.xaml#L19
BarItemDisplayMode="ContentAndGlyph"
GlyphSize="{Binding ElementName=sizeEditor, Path=EditValue}"/>
<dxb:BarButtonItem Content="Notebook"
<dxlc:LayoutItem Label="Patient name:">
<dxe:TextEdit x:Name="subjectEdit" EditValue="{Binding Subject, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
</dxlc:LayoutItem>
dxrichedit-for-wpf-how-to-implement-progress-indicator/CS/MyProgressIndicator.cs#L43
_Indicator.Maximum = maxProgress;
_Indicator.EditValue = currentProgress;
_Indicator.Visibility = System.Windows.Visibility.Visible;
wpf-richedit-use-docvariable-fields/CS/MyProgressIndicator.cs#L33
_Indicator.Maximum = maxProgress;
_Indicator.EditValue = currentProgress;
_Indicator.Visibility = System.Windows.Visibility.Visible;
if(edit.EditValue != null && decimal.TryParse(edit.EditValue.ToString(), out newValue)) {
if (item.Value == null || !decimal.TryParse(item.Value.ToString(), out oldValue))
this.EditValue = editValue;
this.EndDataUpdate();
dxrichedit-for-wpf-how-to-implement-progress-indicator/VB/MyProgressIndicator.vb#L41
_Indicator.Maximum = maxProgress
_Indicator.EditValue = currentProgress
_Indicator.Visibility = System.Windows.Visibility.Visible
wpf-richedit-use-docvariable-fields/VB/MyProgressIndicator.vb#L32
_Indicator.Maximum = maxProgress
_Indicator.EditValue = currentProgress
_Indicator.Visibility = System.Windows.Visibility.Visible
If edit.EditValue IsNot Nothing AndAlso Decimal.TryParse(edit.EditValue.ToString(), newValue) Then
If item.Value Is Nothing OrElse Not Decimal.TryParse(item.Value.ToString(), oldValue) Then
Me.EditValue = editValue_Renamed
Me.EndDataUpdate()
See Also