DXEditMenuItem.Edit Property

Gets or sets the object that determines the editor's type and contains its properties.

Namespace: DevExpress.Utils.Menu

Assembly: DevExpress.XtraEditors.v20.1.dll

Declaration

public RepositoryItem Edit { get; set; }
Public Property Edit As RepositoryItem

Property Value

Type Description
RepositoryItem

A RepositoryItem descendant that determines the editor's type and contains its properties.

Examples

The example demonstrates how to add a DateEdit item to a DXPopupMenu and display the menu as a popup toolbar.

DX Edit Menu Item

using DevExpress.LookAndFeel;
using DevExpress.Utils.Menu;
using DevExpress.XtraEditors.Repository;

private void Form1_MouseDown(object sender, MouseEventArgs e) {
    Control parentControl = this;
    Point pt;
    pt = e.Location;
    DXPopupMenu dxPopupMenu = new DXPopupMenu();
    dxPopupMenu.Items.Add(new DXEditMenuItem("dateedit", new RepositoryItemDateEdit(), 
        new EventHandler(OnEditValueChanged), null, null, 100, 0));
    dxPopupMenu.Items.Add(new DXMenuItem("About", new EventHandler(AboutButton_Click)));
    dxPopupMenu.Items.Add(new DXMenuItem("Calculate", new EventHandler(CalculateButton_Click)));
    dxPopupMenu.MenuViewType = MenuViewType.Toolbar;
    ((IDXDropDownControl)dxPopupMenu).Show(barManager1, parentControl, pt);
}

void OnEditValueChanged(object sender, EventArgs e) {
    DXEditMenuItem item = sender as DXEditMenuItem;
    MessageBox.Show(item.EditValue.ToString());
}

void AboutButton_Click(object sender, EventArgs e) {
    //...
}

void CalculateButton_Click(object sender, EventArgs e) {
    //...
}
See Also