BarEditItem.EditValueChanged Event
Occurs when the BarEditItem.EditValue property value changes.
Namespace: DevExpress.XtraBars
Assembly: DevExpress.XtraBars.v24.2.dll
Declaration
Event Data
The EditValueChanged event's data class is EventArgs.
Remarks
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.
Example
The following code shows how to:
- embed a SpinEdit editor in a bar using the BarEditItem object.
- assign an initial value to the editor (BarEditItem);
- handle the
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;
//...
}
See Also