Skip to main content
Bar

BarEditItem.EditValue Property

Gets or sets the in-place editor’s value.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v22.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[Browsable(true)]
[DefaultValue(null)]
public virtual object EditValue { get; set; }

Property Value

Type Default Description
Object null

An Object that specifies the editor’s value.

Remarks

To respond to changing the EditValue property, handle the BarEditItem.EditValueChanged event.

For certain in-place editors, the static WindowsFormsSettings.InplaceEditorUpdateMode property controls the time when the BarEditItem.EditValueChanged event fires - immediately or after the in-place editor loses focus. 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.

BarEditItem-EditValue-example.png

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