windowsforms-devexpress-dot-xtrabars-dot-baredititem-466e07c8.md
Occurs when the BarEditItem.EditValue property value changes.
Namespace : DevExpress.XtraBars
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public event EventHandler EditValueChanged
Public Event EditValueChanged As EventHandler
The EditValueChanged event's data class is EventArgs.
Cast the sender event parameter to the BarEditItem type to identify the item whose value has been changed. To get the new value, read the BarEditItem.EditValue property.
For certain in-place editors, the WindowsFormsSettings.InplaceEditorUpdateMode static setting specifies when a BarEditItem raises the EditValueChanged event - after the editor loses focus (default), or with each change made in the in-place editor. See WindowsFormsSettings.InplaceEditorUpdateMode to learn more.
The following code shows how to:
BarEditItem.EditValueChanged event to perform actions when the editor’s value changes.private void Form1_Load(object sender, EventArgs e) {
// Create a BarEditItem with embedded SpinEdit in-place editor.
BarEditItem item = new BarEditItem(barManager1);
item.Edit = barManager1.RepositoryItems.Add("SpinEdit");
bar1.AddItem(item);
item.EditValueChanged += BarEditItem1_EditValueChanged;
// Specify the editor's initial value.
int initialValue = 0;
item.EditValue = initialValue;
}
// Perform actions when the editor's value changes
private void BarEditItem1_EditValueChanged(object sender, EventArgs e) {
BarEditItem item = sender as BarEditItem;
object newValue = item.EditValue;
//...
}
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' Create a BarEditItem with embedded SpinEdit in-place editor.
Dim item As BarEditItem = New BarEditItem(BarManager1)
item.Edit = BarManager1.RepositoryItems.Add("SpinEdit")
Bar1.AddItem(item)
AddHandler item.EditValueChanged, AddressOf BarEditItem1_EditValueChanged
' Specify the editor's initial value.
Dim initialValue As Integer = 0
item.EditValue = initialValue
End Sub
' Perform actions when the editor's value changes
Private Sub BarEditItem1_EditValueChanged(sender As Object, e As EventArgs)
Dim item As BarEditItem = CType(sender, BarEditItem)
Dim newValue As Object = item.EditValue
'...
End Sub
See Also