PropertyGridControl.RowBrickMenuShowing Event

Allows you to populate a context menu invoked with a click on a brick button (the Office view only).

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v20.1.dll

Declaration

public event PopupMenuShowingEventHandler RowBrickMenuShowing
Public Event RowBrickMenuShowing As PopupMenuShowingEventHandler

Event Data

The RowBrickMenuShowing event's data class is PopupMenuShowingEventArgs. The following properties provide information specific to this event:

Property Description
Menu Gets or sets the control's popup menu that will be shown.
Row Gets the row where the popup menu will be displayed.

Remarks

In the Office view (see PropertyGridControl.ActiveViewType), you can display brick buttons against properties by setting the PropertyGridControl.OptionsView.ShowRowBrick property to True (see PGridOptionsView.ShowRowBrick).

PropertyGrid_Bricks

The RowBrickMenuShowing event allows you to populate the menu.


using DevExpress.Utils.Menu;

propertyGridControl1.RowBrickMenuShowing += propertyGridControl1_RowBrickMenuShowing;
private void propertyGridControl1_RowBrickMenuShowing(object sender, DevExpress.XtraVerticalGrid.Events.PopupMenuShowingEventArgs e) {
    if (e.Row.Properties.FieldName == "Appearance.BackColor")
        e.Menu.Items.Add(CreateDataBindingItem);
}
DXMenuItem createDataBindingItem;
protected DXMenuItem CreateDataBindingItem {
    get {
        if (createDataBindingItem == null) {
            DXMenuItem item = new DXMenuItem("Create Data Binding...");
            item.Click += (s, ee) => MessageBox.Show("'Create Data Binding...' is clicked.");
            createDataBindingItem = item;
        }
        return createDataBindingItem;
    }
}
NOTE

Items added using this event are not shown when the menu is invoked with a right-click on a property (see PGridOptionsView.ShowRowBrick).

You can also customize the brick buttons by handling the PropertyGridControl.CustomDrawRowBrick event.

See Also