Back to Devexpress

BaseEdit.EditValueChanged Event

windowsforms-devexpress-dot-xtraeditors-dot-baseedit-aeae61f4.md

latest8.3 KB
Original Source

BaseEdit.EditValueChanged Event

Fires immediately after the edit value has been changed.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Events")]
public event EventHandler EditValueChanged
vb
<DXCategory("Events")>
Public Event EditValueChanged As EventHandler

Event Data

The EditValueChanged event's data class is EventArgs.

Remarks

The edited value is specified by the BaseEdit.EditValue property. Each time this property value changes, the EditValueChanged event is raised.

The editor’s EditValueChanged event is equivalent to the RepositoryItem.EditValueChanged event available via the BaseEdit.Properties object, i.e. adding/removing an event handler for the current event actually affects the RepositoryItem.EditValueChanged event.

See the RepositoryItem.EditValueChanged topic for more information.

Example

The following example shows how to respond to changing an editor’s value by handling the EditValueChanged event.

csharp
private void textEdit1_EditValueChanged(object sender, EventArgs e) {
    TextEdit textEditor = (TextEdit)sender;
    if(Equals(textEditor.EditValue, "000")) {
        //...
    }
}
vb
Private Sub TextEdit1_EditValueChanged(sender As Object, e As EventArgs) Handles TextEdit1.EditValueChanged
    Dim textEditor As TextEdit = CType(sender, TextEdit)
    If Equals(textEditor.EditValue, "000") Then
        '...
    End If
End Sub

The following code snippets (auto-collected from DevExpress Examples) contain references to the EditValueChanged event.

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.

winforms-grid-filter-lookup-column-based-on-another-column-editform/CS/FilterLookUpsEditForm/FormDifferentSources.cs#L54

csharp
{
    baseLookUp.EditValueChanged -= baseLookUp_EditValueChanged;
    baseLookUp.EditValueChanged += baseLookUp_EditValueChanged;

winforms-pictureedit-add-custom-graphic-operation-watermark/CS/WatermarkDemo/WatermarkDemo/WatermarkToolControl.cs#L21

csharp
teText.TextChanged += (s, e) => RaiseChanged();
cpeColor.EditValueChanged += (s, e) => RaiseChanged();
seFontSize.EditValueChanged += (s, e) => RaiseChanged();

reporting-winforms-label-report-in-code/CS/Reporting_how-to-create-a-label-report-at-runtime-t473792/Form1.cs#L65

csharp
lookUpLabelProduct.Properties.ValueMember = "Id";
lookUpLabelProduct.EditValueChanged += LookUpLabelProduct_EditValueChanged;
lookUpLabelProduct.Properties.EndInit();

winforms-combobox-hide-specific-items/CS/MyComboBoxEdit/Form1.cs#L10

csharp
InitializeComponent();
this.indexesCheckedComboBox.EditValueChanged += indexesCheckedComboBox_EditValueChanged;
this.indexesCheckedComboBox.Properties.EditValueType = DevExpress.XtraEditors.Repository.EditValueTypeCollection.List;

winforms-data-lookups-combobox-mode/CS/Lookup-ComboboxMode/Form1.cs#L25

csharp
void initLookupEdit() {
    lookUpEdit1.EditValueChanged += LookUpEdit1_EditValueChanged; ;
    lookUpEdit1.Properties.NullText = "(select or type value)";

winforms-grid-filter-lookup-column-based-on-another-column-editform/VB/FilterLookUpsEditForm/FormDifferentSources.vb#L52

vb
If baseLookUp IsNot Nothing AndAlso filteredLookUp IsNot Nothing Then
    RemoveHandler baseLookUp.EditValueChanged, AddressOf baseLookUp_EditValueChanged
    AddHandler baseLookUp.EditValueChanged, AddressOf baseLookUp_EditValueChanged

winforms-pictureedit-add-custom-graphic-operation-watermark/VB/WatermarkDemo/WatermarkDemo/WatermarkToolControl.vb#L24

vb
AddHandler teText.TextChanged, Sub(s, e) RaiseChanged()
AddHandler cpeColor.EditValueChanged, Sub(s, e) RaiseChanged()
AddHandler seFontSize.EditValueChanged, Sub(s, e) RaiseChanged()

reporting-winforms-label-report-in-code/VB/Reporting_how-to-create-a-label-report-at-runtime-t473792/Form1.vb#L57

vb
lookUpLabelProduct.Properties.ValueMember = "Id"
AddHandler lookUpLabelProduct.EditValueChanged, AddressOf LookUpLabelProduct_EditValueChanged
lookUpLabelProduct.Properties.EndInit()

winforms-combobox-hide-specific-items/VB/MyComboBoxEdit/Form1.vb#L14

vb
InitializeComponent()
AddHandler indexesCheckedComboBox.EditValueChanged, AddressOf indexesCheckedComboBox_EditValueChanged
indexesCheckedComboBox.Properties.EditValueType = DevExpress.XtraEditors.Repository.EditValueTypeCollection.List

winforms-data-lookups-combobox-mode/VB/Lookup-ComboboxMode/Form1.vb#L23

vb
Private Sub initLookupEdit()
    AddHandler lookUpEdit1.EditValueChanged, AddressOf LookUpEdit1_EditValueChanged
    lookUpEdit1.Properties.NullText = "(select or type value)"

See Also

Text

EditValue

EditValueChanging

EditValueChangedFiringMode

Validating

BaseEdit Class

BaseEdit Members

DevExpress.XtraEditors Namespace